View Full Version : Delay Interstitial Popup 5-10 seconds

10-16-2010, 01:34 AM
1) Script Title: Interstitial Content Box

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/interstitial.htm

3) Describe problem:

I want to be able to delay the Interstital from loading, I guess on a timer, for about 5-10 seconds after page is loaded or reached.

Very little on Google/forums/everywhere about this. Heck I just thought it was a lightbox advertisement and had a hard time finding out this was the correct definition. It's crazy because a ridiculous amount of sites use this.

Don't even have it up on a Web site yet for an example. But I have it working on a test page normally, just want to delay the load.

10-16-2010, 08:20 AM

if (this.interContainer.style.display=="none") return //if interstitial box has already closed, just exit (window.onresize event triggers function)
var ie=document.all && !window.opera
var dom=document.getElementById
var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth
var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight
var objwidth=this.interContainer.offsetWidth
var objheight=this.interContainer.offsetHeight
this.interVeil.style.width=docwidth+"px" //set up veil over page
this.interVeil.style.height=docheightcomplete+"px" //set up veil over page
this.interVeil.style.left=0 //Position veil over page
this.interVeil.style.top=0 //Position veil over page
this.interContainer.style.left=docwidth/2-objwidth/2+"px" //Position interstitial box
var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+5+"px" //Position interstitial box
if (this.autohidetimer && parseInt(this.autohidetimer)>0 && typeof this.timervar=="undefined")
this.timervar=setTimeout("interstitialBox.closeit()", this.autohidetimer*1000)
var oop=this;
oop.interVeil.style.visibility="visible" //Show veil over page
oop.interContainer.style.visibility="visible" //Show interstitial box

10-16-2010, 09:35 PM
do i just insert that into the JS file?

ps: thanks for the answers

10-17-2010, 07:51 AM
replace the current 'showcontainer' function with the posted 'showcontainer' function and add the new property 'showdelay:5000,' to set the delay

10-18-2010, 12:27 AM

Would you know why is it now allowing javascript to be shown in the linked html or php? file http://dejesusdriveways.com/locater.html

10-18-2010, 07:50 AM
the script is not on the link you posted

10-18-2010, 08:07 AM
? it is to me, it takes a few seconds to load (check the locater files)

10-18-2010, 08:48 AM
thanks for sharing this!

[url=http://www.soccerjerseyculture.com">football shirts wholesale (http://www.soccerjerseyculture.com">football shirts supplier[/url)

10-18-2010, 04:31 PM
nice blatant spam -.-

can I become an mod now? ;)

10-18-2010, 06:06 PM
PS VWPhillips: I have it set so the cookie only shows once per browser session, maybe that's why it didn't show up before for you?

10-20-2010, 12:26 AM
Vic? :( Maybe i'll just try throwing it into an iframe, i got 2 clients who are on my butt about finishing this :(