Click here to Skip to main content
15,911,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have images in folder, I want to rotate images using JavaScript, I am using following code , but it not working fine, please hep me

JavaScript
 <script language="javascript" type="text/ecmascript">
        //Declare golobal variable
        var index = 0;
        var dispStatus = "Play";
        var resetDesplay;
        var timeInerval = 2000;

        //Function to set net image from the array of image list
        function SetNextImage() {
            timeInerval = document.getElementById("hdnTimeOut").value;
            var imageArray = document.getElementById("hdnImage").value.split('|');
            document.getElementById("imageMain").src = imageArray[index];
            if (index >= imageArray.length - 1) {
                index = 0;
            }
            else {
                index++;
            }

            //Recussive call of function with time out
            if (dispStatus == "Play") {
                resetDesplay = setTimeout("SetNextImage()", timeInerval);
            }
        }
</script>
Posted
Updated 30-Apr-12 23:17pm
v2
Comments
Sergey Alexandrovich Kryukov 1-May-12 0:37am    
What do you mean by rotation here? I don't see where you try to rotate anything in any sense...
--SA

It is not called rotating the image. Rotating the image is flipping the image in 90,180 or 270 degrees..

What you need is called as slideshow..

Check this reference

http://www.barelyfitz.com/projects/slideshow/wizard/[^]
 
Share this answer
 
This may help you
Rotate Image[^]
 
Share this answer
 

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