Posted By

cerxx on 11/15/18


Tagged

js-hacks


Versions (?)

How can I detect when the mouse leaves the window?


 / Published in: JavaScript
 

URL: https://stackoverflow.com/questions/923299/how-can-i-detect-when-the-mouse-leaves-the-window#answer-48281888

In order to detect mouseleave without taking in account the scroll bar and the autcomplete field or inspect

  1. document.addEventListener("mouseleave", function(event){
  2. if(event.clientY <= 0 || event.clientX <= 0 || (event.clientX >= window.innerWidth ||
  3. event.clientY >= window.innerHeight)){
  4. ifc.desertgage();
  5. }
  6. });

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: milessmith on November 20, 2018

Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one. https://messenger.red/ https://hotstar.onl/ https://kodi.software/download/

You need to login to post a comment.