<
script type="text/javascript"> $(document).ready(function() { var i;
for(i=0;i<100;i++) { $("#pic1").fadeIn(1000).delay(3000).fadeOut(1000); $("#pic2").delay(4000).fadeIn(1000).delay(3000).fadeOut(1000); $("#pic3").delay(8000).fadeIn(1000).delay(3000).fadeOut(1000); } }); </script>
this is how am making the slider to slide again and again by making the for loop condition 100 times teach me the other better and easy way thanks
$(function() { var pictures = $('.commonPicClass'); var iPic = 0; function nextPic() { pictures.eq(iPic).fadeOut(1000); iPic = ++iPic % pictures.length; pictures.eq(iPic).fadeIn(1000); setTimeout(nextPic, 4000); } pictures.hide(); pictures.eq(iPic).fadeIn(1000); setTimeout(nextPic, 4000); });
I don't like duplicating code, if some one has a better solution for the double fadeIn and setTimeout, let me know :P
fadeIn
setTimeout
Demo: http://codepen.io/CrocoDillon/pen/lKebs
<
script type="text/javascript"> $(document).ready(function() { var i;
this is how am making the slider to slide again and again by making the for loop condition 100 times teach me the other better and easy way thanks
I don't like duplicating code, if some one has a better solution for the double
fadeInandsetTimeout, let me know :PDemo: http://codepen.io/CrocoDillon/pen/lKebs