I have two images. I need to show the first for 5 seconds and then switch to the second image and stay. I don't need the images to keep rotating. Could someone please show me the code for this? Positive rep for anyone that can help.
Hello, Following is the script for you. Checked it. <html> <head> </head> <body onLoad="startTime()"> <img name="imgstar" src="images/1.jpg" border="0"> <script type="text/javascript"> var icount =1; function startTime() { t=setTimeout('startTime()',5000); icount = icount + 1; if (icount == 3) exit(); document.imgstar.src="images/"+icount+".jpg"; } </script> </body> </html> Code (markup): You can increase the time in milisecond using setTimeout('startTime()',5000); Code (markup): function.
Hello You only required to put two images in image folder named it 1.jpg & 2.jpg. Then this script will work for you.