Image rotate to mouse using Jquery and CSS

Posted by James on Stack Overflow See other posts from Stack Overflow or by James
Published on 2011-06-21T13:56:43Z Indexed on 2011/06/21 16:22 UTC
Read the original article Hit count: 176

Filed under:
|
|
|

I have a compass image and am trying to get the needle to follow the mouse around the page, exactly how the images are rotated in the following demo but without having to shift and click. I'm having trouble breaking down that code however, so any help would be most appreciated. Thanks in advance.

http://www.elated.com/res/File/articles/development/javascript/jquery/smooth-rotatable-images-css3-jquery/

The images are simply wrapped in a div

<div id="content">
<img id="compass" src="compass.png"/>
<img id="needle" src="needle.png"/>
</div>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about mouse