I need to execute a single function on a set of adjacent DIVS on my page. I thought it would work best like this:
function namedFunction(){
setTimeout(3000);
//do animations and such
$(this).next().call(namedFunction);
}
$("#firstdiv").call(namedFunction());
but I can’t find a way to arbitrarily execute a function in a set scope (the firstdiv object), and moreover I’m not even sure if the scope will be passed correctly. Is there a way to do this, or a better way to do this?
I guess you want this:
and then: