javascript - how to display alert when mouse cursor goes out of window -
i want display alert when mouse goes out of window . http://ezwebsitebiz.com/testing-content/
i want in jquery . how can achived
var currentmousepos = { x: -1, y: -1 }; jquery(document).mousemove(function(event) { currentmousepos.x = event.pagex; currentmousepos.y = event.pagey; }); jquery(document).mouseleave(function() { var window_width = jquery(window).width(); var window_height = jquery(window).height(); if((currentmousepos.x < window_width) && (currentmousepos.y > 50)) return true; alert(currentmousepos.x.tostring()); })
replace alert message popup window or fancy box
Comments
Post a Comment