javascript exit slide

Discussion in 'JavaScript' started by Edynas, Aug 20, 2006.

  1. #1
    I want a slide in page when ppl leave my site other then links on my page. So I need somekind of modification of an exit popup.

    What is the best way to do this? Add a function to each link on the page or is there a better way to do this?
     
    Edynas, Aug 20, 2006 IP
  2. Darrin

    Darrin Peon

    Messages:
    123
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you could add the "onUnload" event to the <BODY> tag of the page. That should fire whenever the page exits. Then you can run the script that you want from there.

    There is also an "onblur" event that I think will fire when the page loses focus. You will want to check on browser compat. with these, though.
     
    Darrin, Aug 21, 2006 IP