Forum Moderators: open
Basically I need...
//display image one for 2 secs
//replace with image two, display for 1.5 secs
//replace with image three, display for 6 secs
//loop forever!
Is this possible with js? All the scripts I have come across are reams and reams of code which do complicated stuff I don't want. I've also been playing around with some basic image swapping code snippets I found, none of which seem to work in Firefox! I need it to be cross browser.
Can anyone help?
<script type="text/javascript">
function playSlideShow(newImage){
document.getElementById('slideshow').src=newImage;
}
var cnt=0;
function allImages(){
switch(cnt){
case 0:
playSlideShow('images/menu_02.gif');
cnt++;
break;
case 1:
playSlideShow('images/menu_03.gif');
cnt++;
break;
case 2:
playSlideShow('images/menu_04.gif');
cnt=0;
break;
}
}
</script><img src="images/menu_01.gif" width="104" height="74" border="0" id="slideshow" alt="" />
<script type="text/javascript">
window.setInterval("allImages()", 3000);
</script>