Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Jquery Exit Popup
06-21-2014, 01:24 AM #1
- Join Date
- Jun 2014
- Thanked 0 Times in 0 Posts
Jquery Exit Popup
I want to create what is called an "Exit Popup" in Jquery with the following attributes
1. The popup is triggered when the visitor moves their mouse outside of the page.
2. The popup box enters from either the left or right, outside the page.
3. When the Exit Popup appears, I want it to have an "X" or close button, so the visitor can close the popup.
4. I want a checkbox inside the popup that says "don't show this again".
5. If the visitor clicks to "check" the checkbox, I want the exit popup to dissapear and a cookie placed in the visitor's browser.
6. I want the code to prevent execution of the popup if it finds this cookie in the visitor's browser
I would appreciate some direction on developing this.
06-21-2014, 01:45 AM #2
1. putting a mouseout listener on the html node will tell you when the mouse has left the window
2. if you are using jQuery, I guess animate() would be helpful here, although it's fairly simple to do in vanilla js
3. again, if using jQuery, dialog from the jQuery UI provides ready-made solutions (plus an animation for how it appears). And again, not hard to do without jQ
4. simple enough.
5. plenty of info out there on cookies. No point repeating it here
6. so you would put the code checking for the existence of the cookie before showing the dialog