|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
How to have rotating images on my website? I am not very well versed with programming languages and website development, but have got a sound understanding of html. I am planning to build a website now, that has two images on it, but only one image is shown at a time. to be exact, i want my images to be changed after every few seconds. Can anyone help me in coding for the same..??? |
#2
| |||
| |||
Re: How to have rotating images on my website? Try this code, but please be careful when you insert the image path. Code: <html> <head> <title>Image Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="javascript" type="text/javascript"> img = new Image() seconds = "5"; function FirstImg() { document.myimg.src = 'http://somewhere.org/Images/Image1.gif'; //add first image address here setTimeout("SecondImg()", seconds * 1000); } function SecondImg() { document.myimg.src = 'http://somewhere.org/Images/Image2.jpg';//second image storage place setTimeout("FirstImg()", seconds * 1000); } </script> </head> <body onload="firstImg();"> <img src="http://somewhere.org/Images/Image1.gif" name="myimg"> </body> </head> |
#3
| |||
| |||
Re: How to have rotating images on my website? Code: <body onLoad="slideShow(50000,0)"> <script language="JavaScript"> var j,d=" ",l=" ",m=" ",p=" ",q=" ",z=" ",arr= new Array() arr[arr.length]='/firstImg.jpg'; arr[arr.length]='/secondImg.jpg'; j=parseInt(Math.random()*arr.length); j=(isNaN(j))?0:j; document.write("<img name='slideShow' src='"+arr[j]+"'>"); function slideShow(t,l) { x=document.slideShow; j=l; j++; if (j==arr.length) j=0; x.src=arr[j]; setTimeout("slideShow("+t+","+j+")",t); } </script> </body> |
#4
| |||
| |||
Re: How to have rotating images on my website? Well cannot you make a GIF image with the pictures you want and the delay that is required and then upload it to the html?? I think this can ease the work a lot. Also wanna know if in programming, i want to add captions to the image i am uploading, what should i do? |
![]() |
|
Tags: changing image, html, website |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to disable copy pasting or printing of images/texts from website? | Jaques Strapp | Technology & Internet | 4 | 20-01-2012 01:31 PM |
Rotating Cylinders | zbathich | Software Development | 2 | 26-04-2011 04:18 AM |
Rotating Controls in VB.NET | GracieSingh | Software Development | 5 | 30-03-2010 12:06 AM |
How to skip images or pictures to speed slow website? | Yarn | Technology & Internet | 3 | 05-03-2009 06:05 PM |
The Godfather Part 2: Images and official website at EA | Rawko | Video Games | 5 | 02-12-2008 08:30 PM |