PDA

View Full Version : DHTML Window Widget - load on exiting/leaving page? or Popunder?



deeklex
04-18-2007, 01:30 AM
1) Script Title: DHTML Window Widget

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/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

thetestingsite
04-18-2007, 01:38 AM
Not sure if this will work, but in the body tag you could use the onunload attribute to trigger the window.

Example:



<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.

deeklex
04-18-2007, 03:15 AM
^^^
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!

thetestingsite
04-18-2007, 03:19 AM
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.

deeklex
04-19-2007, 03:02 PM
^^^
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 :)