jquery - loop slider is not being called -
i have slider.
$(function () { $(".fadein a").first().show(); var lnthofimages = $('.fadein a').length; var index = 0; var count = lnthofimages; function bannerrotator() { $('.fadein a').delay(5).eq(index).fadeout(function () { if (index == count) { index = -1; } $('.fadein a').eq(index + 1).fadein(function () { index++; bannerrotator(); }); }); } bannerrotator(); });
where images not being rotated. not being cycled according condition i've given here-
$('.fadein a').eq(index + 1).fadein(function () { index++; bannerrotator(); });
you can see here-
try fiddle : http://jsfiddle.net/94bgb/3/
i updated line here, because index goes 0 5 count 6, need compare index count-1.
if (index == count-1) { index = -1; }
Comments
Post a Comment