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: 205
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.
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