Transform in jQuery

后端 未结 9 1182
野趣味
野趣味 2020-12-06 03:24

I\'m trying to get an element to animate a rotation hover effect using jquery, I have this jsFiddle going to test. So Far I have this:

$(\".icon\").hover(fun         


        
9条回答
  •  旧时难觅i
    2020-12-06 04:10

    Use the excellent jQuery Rotate plugin. http://code.google.com/p/jqueryrotate/. It is supported by all major browsers

    * Internet Explorer 6.0 >
    * Firefox 2.0 >
    * Safari 3 >
    * Opera 9 >
    * Google Chrome 
    

    To rotate an image, All you need to do is $('#myImage').rotate(30) //for a 30 degree rotation Where #myImage is the id of the element you want rotated.

    To animate rotation, you can use setTmeout ex:

    setTimeout(function() { $('#myImage').rotate(30) },5)
    

提交回复
热议问题