»
EnglishFrenchVietnamese

Print - Different image according to time - JavaScriptBank.com

Full version: jsB@nk » Image » Different image according to time
URL: https://www.javascriptbank.com/different-image-according-to-time.html

Different image according to time © JavaScriptBank.comThis JavaScript changes the image many times a day, depending on the time specified period and display description in status bar.

Full version: jsB@nk » Image » Different image according to time
URL: https://www.javascriptbank.com/different-image-according-to-time.html



JavaScript
<SCRIPT language=JavaScript><!-- hide from other browsers//Pictures to switch inbetweenvar Rollpic1 = "logojs.gif";var Rollpic2 = "photo2.jpg";var Rollpic3 = "photo6.jpg";//Start at the what pic:var PicNumber=1;//Number of pics:var NumberOfPictures=3;//Time between pics switching in secsvar HowLongBetweenPic=5;//SwitchPic Functionfunction SwitchPic(counter){if(counter < HowLongBetweenPic){counter++;//DEBUG in the status bar at the bottom of the screenwindow.status="Switch picture at 5 : "+counter+" PicNumber: "+PicNumber+" ";//Display pic in what <IMG> tag roll is what I called the imagedocument.roll.src = eval("Rollpic" + PicNumber);//function calls itselfCallSwitchPic=window.setTimeout("SwitchPic("+counter+")",1500); }else{//if its not the last picture goto the next pictureif(PicNumber < NumberOfPictures){PicNumber++;SwitchPic(0);}//its the last picture go to the first oneelse{PicNumber=1;SwitchPic(0);}}}// Stop hiding from old browsers --></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onload=SwitchPic(0)><IMG src="logojs.gif" border=0 name=roll></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->