Click here to Skip to main content
15,917,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to Rotate Image using JavaScript after a time setting?
Any one please help me?
Posted
Updated 3-Jun-10 20:03pm
v2

 
Share this answer
 
v2
I have found this.

http://www.go4expert.com/forums/showthread.php?t=1012[^]

If you will do a google on jQuery plugin for image rotation you will definitely find many examples.
 
Share this answer
 
Step I:
<body onload="showimg()">
<img id="img1" runat="server" width="120px" />
 </body>

Note:->Here we call a js function(showimg()) on the onload event.

Step 2:->Create a javascript function(showimg()) in the tag:
JavaScript
function showimg()
{
document.getElementById('img1').src="Water lilies.jpg";
setTimeout("show2()",1000);
}
function show2()
{
document.getElementById('img1').src="Winter.jpg";
setTimeout("show3()",1000);
}
function show3()
{
document.getElementById('img1').src="Sunset.jpg";
setTimeout("show4()",1000);
}
function show4()
{
document.getElementById('img1').src="Blue hills.jpg";
setTimeout("show()",1000);
}

In the above function, setTimeout will disapper that image after defined time in the parameters
 
Share this answer
 
v2
Comments
Sandeep Mewara 6-Jun-10 2:47am    
Use pre tags to format code part. They are your friends!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900