开发者

Mouse events in JavaScript?

How would I go about making an image follow the mouse using J开发者_如何学编程avaScript? I'm currently working with the new HTML5 canvas element. (The image I want the mouse to follow is on the canvas, I just want it to follow the mouse's position.)


You can tie the image's position to the onmousemove event, you can see my demo here for doing that with regular JavaScript: http://jsbin.com/ogabi3/2

Things like jQuery UI's position utility will help provide collision detection with the browser

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜