Web Analytics Made Easy -
StatCounter CSS popup when user leaves page - CodingForum

Announcement

Collapse
No announcement yet.

CSS popup when user leaves page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CSS popup when user leaves page

    I need to show a CSS popup with some simple content when a user navigates away from a page.

    Events that should trigger this CSS popup:
    - when a user clicks a link to navigate away from interface
    - when a user tries to close the window/tab

    I've been trying with jQuery using window.unload or window.onbeforeunload but have had little luck.

    Is there a tutorial somewhere or a demo I can check out?

  • #2
    This is not possible. Browsers equipped with pop-up window blockers (i.e all modern ones) will ignore all window.open() method calls in onunload event handler functions.



    "We have been asked to correct our report on the wedding last week. On return from honeymoon the happy couple will be staying at The Old Manse and not as we stated at the home of the bridegroom's father." - Local Newspaper report.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

    Comment


    • #3
      Yeah, that's why I'm asking about a CSS popup, not a new window.
      Just some content in a lightbox, if you will.

      Comment


      • #4
        Have a look here. It costs $27.

        http://www.geckotribe.com/expop/?gcl...FQKenAodJ101XA

        I guess you realise that these exit pop-ups annoy your visitors and often discourage them from returning to the site.

        All the code given in this post has been tested and is intended to address the question asked.
        Unless stated otherwise it is not just a demonstration.

        Comment

        Working...
        X