Detect When a Mouse Leaves the Window with Glio.js

How many times do you go to close a tab and notice a modal window asking you to stay? This seems commonplace nowadays and it’s done for one reason: it works!

You can build a similar effect using the Glio.js library. It’s a free open-source JS script to detect when the user’s mouse cursor is getting close to the edge or when it leaves the browser window.

This can be used to try keeping visitors on your site. But, it can also be used to create dynamic effects if the user’s mouse goes far to one side of the screen.

Source: Detect When a Mouse Leaves the Window with Glio.js