var counter = 0;
jQuery("#div1, #div2").fadeIn('300',function(){
{
counter++;
console.log(counter);
}
The code above will print “1” and “2” since the jQuery fadeIn is implied on two different DOM objects.
Is there anyway to cause it to run only once without breaking this code?
It’s a quick solution but not the best
Hope this helps… Muhammad.