Hey all. Basically, I need "(this)" in my function to correspond to this selection:
$(".widget .portfolio img")
But I want alternative ways of running this function, one when it is cilcked, and one in intervals, like this:
function cycle()
{
var poo = $(this).attr("id");
$(".poo").html(poo);
}
$(".widget .portfolio img").click(function() {
cycle();
});
setInterval(function() {
cycle();
}, 4000);
});
The problem is that when the interval runs, the function's value of "(this)" is that of the setInterval function - but I want it to be the selection I said above... if I could do something like this, it would be ideal:
setInterval(function() {
cycle($(".widget .portfolio img"));
...
I think I just need a simple something in the function... any ideas? Thanks in advance :)