javascript - How can I detect a user about the exit the page? -
i detect when user exit page, before click button, , - example display popup. not want prevent user leaving page, grab attention again.
this done optin monster, want implement myself.
where start?
edit: beforeunload
fired after user clicked or x button. catch exit intent, example when mouse moving towards button, before clicked.
ouibounce this. there live demo here.
npm install ouibounce
then:
var ouibounce = require('ouibounce'); var modal = document.getelementbyid('ouibounce-modal') ouibounce(modal);
Comments
Post a Comment