inforesurs-test/public/js/raw/jquery.follow.js
2019-06-22 17:15:33 +03:00

18 строки
390 B
JavaScript

(function ($) {
$.fn.follow = function () {
var $this = $(this);
function follow_mouse(obj) {
$('body').mousemove(function (e, h) {
$(obj).offset({top: e.pageY, left: e.pageX});
$(obj).click(function () {
$('body').off('mousemove')
})
})
}
$this.mouseover(function (e, h) {
follow_mouse(this);
});
};
})(jQuery);