1

The best way I can describe what I am talking about is say you are on a webpage and you start to move your mouse to move to the "back" button. Once your mouse leaves the webpage area, I want to show a window appear within the webpage and shows something inside of it.

So it is a way to notify the user of something before they are going to leave the website? Does anyone know of how you would go about this or what to use? Or any tutorials on this? I'm thinking javascript with mousemovement or jquery possibly, but I can't find anything around online.

Is there a specific name for the webpage area of a website that is more proper so I would find this online? Thanks

king
  • 1,304
  • 3
  • 23
  • 43

1 Answers1

1

You can detect the mouse leaving the window by doing something like this:

addEvent(document, 'mouseout', function(evt) {
  if (evt.toElement == null && evt.relatedTarget == null) {
    alert("left window");
  }
});

I found a good answer to your question on THIS post.

Community
  • 1
  • 1
Cyzanfar
  • 6,997
  • 9
  • 43
  • 81