This jQuery issue has been listening to me for a while. I developed a script, with one function detecting when the mouse goes to the top of the page. Here is the code:
$(document).bind("mouseleave", function(e) { console.log(e.pageY); if (e.pageY <= 1) { now = new Date(); for (i=0; i < times.length; i++) { if (now.getTime() > times[i][0] && now.getTime() < times[i][1]) { $.fn.colorbox({iframe:true, width:650, height:600, href: "work.html", open: true}); } } } });
This works great for me in all browsers. For some reason, it works by chance in Chrome and, it would seem, not at all in Firefox for a friend who tested the site. In my browser (firefox 3.5.3) e.pageY is registered in the console as a number about 0, however in my friends browser (also firefox 3.5.3) the lowest value is about 240. I donβt know why this happens taking into account identical browsers. Does anyone know how to debug this, or another more reliable detection method, when a mouse exits a web page from above? Hope this makes sense.
javascript jquery cross-browser
Lobe
source share