html - Jquery loop through li one by one -
i have following code displays li item 1 one.
var show = 1; var current = show - 1; var length = 9; var gallery = $('.quotescroll'); var galleryitems = gallery.children('li'); length = galleryitems.length; setinterval(function(){ current = (current+1)%60; galleryitems.eq(current).slidedown(); galleryitems.eq(current - show).slideup(); }, 10000);
the trouble have need loop throught unordered list continuously. how acheive this?
edit
i found code need, doesn't have nice slide animation.
setinterval(function() { var firstli = $('.quotescroll li').first().detach(); $('.quotescroll').append($(firstli)); }, 5000);
assuming quotescroll
list class:
$('.quotescroll li').each(function() { //this refers each li //do stuff each });
Comments
Post a Comment