Jump to content

[HELP] random image with auto refresh


eko_wardoyo

Recommended Posts

i use this code

	  <html>	  <head>	  <title></title>	  <script type="text/javascript" src="js/jquery-1.4.3.min.js"></script>	  <script language="javascript" type="text/javascript">	  $im_count = 0;	  $img_array = new Array("image/1.jpg","image/2.jpg");	  function changeImage(){	  $("#imgholder").fadeOut().attr("src",$img_array[$im_count%2]).fadeIn();	  $im_count++;	  window.setTimeout("changeImage()",5000);	  }	  $(function(){	  changeImage();	  });	  </script>	  </head>	  <body>	  <h1>This is heading</h1>	  <img src="1.jpg" id="imgholder">	  </body>	  </html>

the problem have been solved :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...