Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我应该如何将此函数编码为旋转?_Javascript_Jquery_Rotation - Fatal编程技术网

Javascript 我应该如何将此函数编码为旋转?

Javascript 我应该如何将此函数编码为旋转?,javascript,jquery,rotation,Javascript,Jquery,Rotation,我有一个功能: function headerNudge(elem, rot, dur) { elem.rotate({ bind: { mouseover : function() { $(this).rotate({ animateTo:rot, duration:dur, callbac

我有一个功能:

    function headerNudge(elem, rot, dur) {
        elem.rotate({ 
        bind: { 
            mouseover : function() { 
                $(this).rotate({
                    animateTo:rot,
                    duration:dur,
            callback: function(){
                $(this).rotate({
                            animateTo:-rot,
                            duration:dur,
                    callback: function(){
                        $(this).rotate({ animateTo:0,duration:dur })
                    }
                })
            }
        })
      }
        }      
        });         
    }
基本上,它只是使用插件将鼠标上的图像推到一张幻灯片上,然后再推到另一张幻灯片上,以产生抖动的效果


我可以看到我的代码看起来非常糟糕,(我来自php/c背景)有人能建议一个更好的方法来实现我的目标吗?

你能利用吗?

这个插件已经在所有平台上运行良好,包括旧版本的ie,所以我不想更改插件,只是我的代码的语法,使它更干净