使用Javascript旋转图像 [英] Rotate Image Using Javascript

查看:81
本文介绍了使用Javascript旋转图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的文件夹中有图像,我想使用JavaScript旋转图像,我正在使用以下代码,但是效果不佳,请帮助我

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

 <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>

推荐答案

这不称为旋转图像.旋转图像会将图像以90,180或270度翻转..

您所需要的称为幻灯片..

检查此参考

http://www.barelyfitz.com/projects/slideshow/wizard/ [
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/[^]


这可能对您有帮助
旋转图像 [
This may help you
Rotate Image[^]


这篇关于使用Javascript旋转图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆