I\'m looking for the shortest way of creating a fading image slideshow using jQuery. Examples I found on google always had a lot a unneccessary special stuff in it and I had tr
Hope below code may help you,
var imgArray = ["img1.jpg","img2.jpg","img3.jpg"]; var i=0; setInterval(function(){ $('div').fadeToggle(2000,function(){ $(this).text(imgArray[i]); }); i++; if(imgArray.length==i-1){ i=0; } },2000);
Demo