Click here to Skip to main content
15,878,970 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I have a requirement that to display a custom popup before leave or close a browser. I've tried with the 'window.onbeforeunload' method. But it always showing the default popup. Could you please help me show a custom popup.
Posted

1 solution

I am afraid, there is no such way to show a custom popup. But you can add custom message on that popup.

Else you can go for another workaround described here - Creating a Jquery Exit Popup[^], which plays with the cusrsor position. Implement, if it satisfies your requirement.
Quote:
Instead a less annoying way of doing this would be to use Jquery and when the users cursor reaches the top of the page, usually a sign that the user is going to close the webpage, a Jquery lightbox will popup.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900