Tuesday, December 9, 2008

JAVA SCRIPT IMAGE ROTATOR - SLIDE SHOW

Hi ..

Today I m going to describe you How we can do image ratation(slide Show as in flash),This is very simple and frankly I got it by googleing(he he he...).And you also enjoy this.

Here is the Code..


[html xmlns="http://www.w3.org/1999/xhtml" ]
[head runat="server"]
[title]Untitled Page[/title]

[script type="text/javascript" type="text/javascript"]

var image1=new Image()
image1.src="Images/4.JPG"
var image2=new Image()
image2.src="Images/5.JPG"
var image3=new Image()
image3.src="Images/6.JPG"

//variable that will increment through the images
var step=1
function slideit()
{
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step[3)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",2500)
}

[/script]
[/head]
[body onload="slideit();"]
[form id="form1" runat="server"]
[div]
[img src="Images/4.JPG" name="slide" width="300" height="156" /]
[/div]
[/form]
[/body]
[/html]



Enjoy the Image Rotating..

Sanjeev Chauhan
HelpOnDesk Team

No comments: