The following code is supposed to perform a click function on each element in the matching set delaying the click by 200ms before it takes effect on each element.
$('.panel').each(function(){
window.setTimeout($('a.last').click(),pdel);
pdel += 200;
});
It all happens at the same time, the timeout function is not working.
I’m assuming
pdelwas declared outside of the each. But you’ll want yoursetTimeoutto use a function, otherwise you are passing the result of the.click()method to thesetTimeout.Try this: