Hey, just released a new plugin. Pretty simple thing that lets you fire an event when the user is about to leave the page, so you can display a popup or whatever. It’s based on Bounceback.
Has three modes:
Mouse: This detects bounces based on the mouse’s direction, velocity and distance from the top of the page.
History: This method uses the HTML5 History APIs (or hashes when in an older browser) to duplicate the page in the history. Then when the visitor clicks to go back, the Exit Intent fires. This method is almost foolproof, but could annoy some users. It works best for mobile browsers.
Auto: Automatically picks a method based on the device type. Mouse is used for desktop browsers and History for mobile.
Why not just use mousey mouse: when mouse y position < 5 = fire action? It works perfectly minus the need to load another library. Just giving you the heads up!
Can’t recall using the back button on my phone I just click the home button and keep it moving. But you’re right! Free is always great… at the same time though… being dependent on yet another library in an already bloated bubble world is pretty costly in a more taxing way… mousey mouse is just raw code. I prefer to run lean on bubble as a result of it’s natural lag.
That’s definitely fair, I’ve not used mousey mouse but it sounds like it can do the job.
That being said, the Bounceback library is 8.89 KB so I don’t think it’s going to add too much bloat
Edit: Actually 1.2 KB minified
@dambusmedia - Thanks for the plugin! I’ve set it up on my site and it’s working. But only the first time. I trigger a popup that shows a warning message. User close the popup and next time they try to go back they succeed. Can I prevent this?