javascript - Creating a loop that fades out each article in succession. jQuery -



javascript - Creating a loop that fades out each article in succession. jQuery -

so thought fade each image out bottom.. it's going have backwardly traverse array. however, can't seem figure out @ moment. thought pause after running fadeout() function, thought set time out work, firebug gives me error: useless settimeout phone call (missing quotes around argument?)

line 262. went far not utilize $.each loop , utilize (i=0 loop

<script type="text/javascript"> //bottom nav functions $(document).ready(function(){ $('#bottomnav a:eq(0)').click(function(){ var arti = $('#aholder article'); var amt = arti.length; var = 0; (i=0;i<amt;i++){ $('#aholder article:eq('+i+')').fadeout(); settimeout(300); } }); }); </script>

something should do:

var = $('#aholder article').length, interval = setinterval(function () { if (i-- <= 0) { clearinterval(interval); return; } $('#aholder article:eq(' + + ')').fadeout(); }, 300);

delayed execution in loop best done interval. 1 time have reached terminating condition, clear it.

javascript jquery

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -