var count=0;
var set1;
function ImageChange()
{
var arr=["jpeg1.jpg","jpeg2.jpg","jpeg3.jpg","jpeg4.jpg","jpeg5.jpg","jpeg6.jpg","jpeg7.jpg",
"jpeg8.jpg","jpeg9.jpg","jpeg10.jpg","jpeg11.jpg","jpeg12.jpg","jpeg13.jpg","jpeg14.jpg",
"jpeg15.jpg","png1.png","png2.png"];
var v1=document.getElementById("i1");
v1.src=arr[count];
count=count+1;
if(count>=arr.length)
{
count=0;
}
};
function f1()
{
var set1=setInterval(ImageChange,1000);
}
function f2()
{
clearInterval(set1);
}
What I have tried:
var count=0;
var set1;
function ImageChange()
{
var arr=["jpeg1.jpg","jpeg2.jpg","jpeg3.jpg","jpeg4.jpg","jpeg5.jpg","jpeg6.jpg","jpeg7.jpg",
"jpeg8.jpg","jpeg9.jpg","jpeg10.jpg","jpeg11.jpg","jpeg12.jpg","jpeg13.jpg","jpeg14.jpg",
"jpeg15.jpg","png1.png","png2.png"];
var v1=document.getElementById("i1");
v1.src=arr[count];
count=count+1;
if(count>=arr.length)
{
count=0;
}
};
function f1()
{
var set1=setInterval(ImageChange,1000);
}
function f2()
{
clearInterval(set1);
};