Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: DHTML Modal window (on exit)

  1. #1
    Join Date
    May 2007
    Posts
    99
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Red face DHTML Modal window (on exit)

    DHTML Modal window v1.1
    http://www.dynamicdrive.com/dynamici...dhtmlmodal.htm

    Hello everyone!
    Can you please tell me if I can edit this script for the window to appear on page exit?
    I would be grateful for any help.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    The only thing that can use the onunload attribute is the alert types(uhh.. I think?).
    You cannot get a modal window to show onunload, but you can do something like:
    Code:
    <body onunload="alert('Bye');">
    Sorry.
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    nycguurl (01-04-2009)

  4. #3
    Join Date
    May 2007
    Posts
    99
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the input.

    I've seen sites that have drop-in windows on page exit. Does anyone else know how I can trigger that on page exit as opposed to onClick or on page load?

  5. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Can you give me an example of a site?
    Jeremy | jfein.net

  6. #5
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Try to use onbeforeunload event instead.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  7. The Following User Says Thank You to rangana For This Useful Post:

    nycguurl (01-04-2009)

  8. #6
    Join Date
    May 2007
    Posts
    99
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Nile View Post
    Can you give me an example of a site?
    HERE is an example of a paid script that does it. But I've seen goodbye popups that do the same thing, I just have to think and remember where. Ideally I'd like to use the Dynamic Drive DHTML Modal window one to do the goodbye thing.

  9. #7
    Join Date
    May 2007
    Posts
    99
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by rangana View Post
    Try to use onbeforeunload event instead.
    Ok I will try that tonight when I get home.

  10. #8
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    That script activates when it can't detect your cursor - not when you close the window.
    Jeremy | jfein.net

  11. #9
    Join Date
    May 2007
    Posts
    99
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    Oh, really?!

    Both would be nice: when they go to leave the page or when their cursor leaves the screen. I'd like to play sround with both of them. Is it simple to do that kind (when you can't see the cursor)?

  12. #10
    Join Date
    May 2007
    Posts
    99
    Thanks
    15
    Thanked 0 Times in 0 Posts

    Default

    P.S. I didn't mean both together, I mean one or the other. Just that I'll play around with both.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •