I'm using this code to detect to mouse leave window and which is working pretty fine.
jQuery(document).mouseleave(function(){console.log('out')})
jQuery(document).mouseenter(function(){console.log('in')});
but in chrome this is returning mouse leave even on touching scroll bar. How can I prevent this? Please advice.
I'm using this code `addEvent(document, "mouseleave", function(e) {
e = e ? e : window.event;
var from = e.relatedTarget || e.toElement;
jQuery(document).mouseleave(function(){
if (!from || from.nodeName == "HTML") {
$(".tso_popup_wrapper")
.animate({"width":"400px","height":"200px"},100)
.animate({"right":"100px", "top":"107px"},500)
.animate({"width":"1000px", "height":"700px"},1)
.animate({"right":"-100px", "top":"107px"},1)
.animate({"width":"1350px", "height":"700px"},1)
.animate({"right":"-298px", "top":"107px"},250);
$('.navigation-all').slideDown(300);
console.log('out');
}
});
`