I was wondering if there is a way to capture some kind of mouse event or another event when the mouse leaves body crossing top border?
Well I have this campaign at my site when the user leaves body element and cookie is not set I show them this popup for one time only. But this event triggers for all sides of body.
tr = trigger event on leave
I woule like:
tr
+----------+
| |
no-tr| |no-tr
| |
+----------+
no-tr
But i have
tr
+----------+
| |
tr| |tr
| |
+----------+
tr
I have something like this:
$("body").one("mouseleave", initPopup)
My question is if there is a way to trigger this event only when the user leaves body by top border, but not for other borders?