Hi folks... I need to show a div when a visitor attempts to leave my page.
Javascript events
8
Hi folks...
I need to show a div when a visitor attempts to leave my page.
I've tried using "onMouseout" on a div.
I've also tried onbeforeunload, and onbeforeunload
These events are not behaving as I expected.
The div shows when a user leaves the page - but also when the page loads.
That's no good.
Also - in the case of "onMouseout" it fires when I try to take the mouse over to the scroll bar and scroll down. Also not good.
O Need something that only shows when the user is leaving - not arriving, or scrolling.
What event should I be using?
Thanks folks!
Doug
I need to show a div when a visitor attempts to leave my page.
I've tried using "onMouseout" on a div.
I've also tried onbeforeunload, and onbeforeunload
These events are not behaving as I expected.
The div shows when a user leaves the page - but also when the page loads.
That's no good.
Also - in the case of "onMouseout" it fires when I try to take the mouse over to the scroll bar and scroll down. Also not good.
O Need something that only shows when the user is leaving - not arriving, or scrolling.
What event should I be using?
Thanks folks!
Doug
- n7 Studios
- dougyitbos
- Jenniferlinn Banned
- n7 Studios
- dougyitbos
- n7 Studios
- dougyitbos
Next Topics on Trending Feed
-
8