zoukankan      html  css  js  c++  java
  • 通过js 插件控制图片旋转

    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>旋转图片</title>
        <script type="text/javascript" src="coos.ui.rotate.js"></script>
    </head>
    <body>
        <div id="testdiv1" style="z-index:4; position: absolute; top:50%;  margin:0 auto; margin-top:-175px; left:50%; margin-left:-175px; 350px; height:350px; background-image:url(shuijing.png)">
        </div>
        <div id="testdiv" style="z-index:10; position: absolute; top:50%;  margin:0 auto; margin-top:-175px; left:50%; margin-left:-175px;">
            <img alt="" id="theimage" border="0" src="star.png" />
        </div>
        <script type="text/javascript">
            var setTime;
            window.onload = function () {
                GetRTime();
            }
            function GetRTime() {
                rotateLeft('theimage', 1); //顺时针1度旋转
                var divObj = document.getElementById("testdiv");
                var divObj_Width = document.getElementById("testdiv").offsetHeight;
                var divObj_Height = document.getElementById("testdiv").offsetWidth;
                divObj.style.marginLeft = "-" + (divObj_Width / 2) + "px";
                divObj.style.marginTop = "-" + (divObj_Height / 2) + "px";
                //rotateRight('theimage', 90); //逆时针90度旋转
                setTime = setTimeout(function () { GetRTime() }, 100)
            }
        </script>
    </body>
    </html>

     附件:https://files.cnblogs.com/wangbogo/%E6%97%8B%E8%BD%AC%E5%9B%BE%E7%89%87-%E6%B0%B4%E6%99%B6%E7%90%83.rar

  • 相关阅读:
    Jmeter与LoadRunner 测试Java项目的坑
    关于<forEach>的<if>混合使用显示数据
    无题。省
    无题。思
    767A Snacktower
    喵哈哈村的括号序列

    队列
    优先队列
    768A Oath of the Night's Watch
  • 原文地址:https://www.cnblogs.com/wangbogo/p/2833677.html
Copyright © 2011-2022 走看看