Results 1 to 5 of 5

Thread: DHTML Window Widget - load on exiting/leaving page? or Popunder?

  1. #1
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DHTML Window Widget - load on exiting/leaving page? or Popunder?

    1) Script Title: DHTML Window Widget

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndow/index.htm

    3) Describe problem:

    Hi, I have discovered this wonderful script and its perfect for what I intend to use on my site, except for one thing.
    I'm using "Window 1, the iFrame content", and was wondering is it possible to get the DHTML window to load when the user closes/leaves the page, like a Farewell Window, or pops under the page, instead of loading on top of the page when the page loads. I am a bit of a javascript n00b, so was unsure of what to look for myself.
    Any help would be appreciated, thanks

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Not sure if this will work, but in the body tag you could use the onunload attribute to trigger the window.

    Example:

    Code:
    <body onunload="dhtmlwindow.open('googlebox', 'iframe', 'http://images.google.com/', 'Google Web site', 'width=700px,height=450px,resize=1,scrolling=1,center=1');">
    Again, not tested and don't know if it will work. Worth a try though.
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ^^^
    Hi, thanks for replying so soon
    I tried changing the code with the onunload function, but it didn't seem to work, not sure if I'm doing something wrong with the javascript.
    Thanks again!

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Sorry to hear that it did not work, but let me play around with it for a little while and I will get back to you with my results.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Apr 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ^^^
    Hey, thanks again for your help ^_^
    I still haven't been able to figure this one out, I've been checking out Javascript references for the last day or so now, haha. Anyone got any ideas?!
    Thanks in advance

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
  •