Plugin jQuery: How To Work Out Distance Between Mouse And Element in jQuery

How To Work Out Distance Between Mouse And Element in jQuery
http://www.jqueryrain.com/?http://www.paulund.co.uk/playground/demo/jquery_distance_from_element/
http://www.paulund.co.uk/how-to-work-out-distance-between-mouse-and-element
14/03/2012

Nội dung

How To Work Out Distance Between Mouse And Element in jQuery

In the tutorial today you will learn how you can use jQuery to get the distance of the mouse from a certain element on the page. This bit of code can be useful on a small web app which has a lot of user interaction and you want an event to run when the user mouse is in a certain distance from an element.There is a demo page for this code, which has a label to show the distance in pixels and an element which we will take the center position for.


Nguồn: www.jqueryrain.com/2012/03/how-to-work-out-distance-between-mouse-and-element-in-jquery/


Chưa có phản hồi
Bạn vui lòng Đăng nhập để bình luận