Showing posts with label Rotating an image with the help of Javascript. Show all posts
Showing posts with label Rotating an image with the help of Javascript. Show all posts

Tuesday, 22 November 2011

JavaScript for Fliping images

<html>
<head>
<script type="text/javascript">
var image1=new Image()
image1.src="images/Gas_Final.jpg"
var image2=new Image()
image2.src="images/Chemical_Plant1_Final.jpg"
var image3=new Image()
image3.src="images/Chemical_Plant2_Final.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)
}
slideit()
</script>
</head>
<body onload="slideit()">
<div class="banner_box"><img src="images/banner.jpg"  name="slide" alt="">
</div>
</body>
</html>