The following code is not working. It doesn't show any image. Please help.
var myVar = setInterval(function(){randim()},1000);
function randim(){
var bannerImages = new Array( );
bannerImages[0] = "1.jpg";
bannerImages[1] = "2.jpg";
bannerImages[2] = "3.jpg";
bannerImages[3] = "4.jpg";
bannerImages[4] = "5.jpg";
bannerImages[5] = "6.jpg";
bannerImages[6] = "7.jpg";
var randomImageIndex = 0;
randomImageIndex = Math.round( Math.random( ) * 6 );
}
function myStopFunction()
{
clearInterval(myVar);
}
A script on this page starts this image change:


Abhijeet SinghRank #415 · 6K reputationPosted Mar 15, 2014, 8:28 PM EDT
http://mrbool.com/how-to-swap-images-using-javascript/26669
If it is helpful then please mark it as answer
Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Mar 15, 2014, 8:47 PM EDT