PDA

View Full Version : Delay Interstitial Popup 5-10 seconds



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

vwphillips
10-16-2010, 08:20 AM
showdelay:5000,

showcontainer:function(){
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
this.interContainer.style.top=Math.floor(parseInt(topposition))+"px"
if (this.autohidetimer && parseInt(this.autohidetimer)>0 && typeof this.timervar=="undefined")
this.timervar=setTimeout("interstitialBox.closeit()", this.autohidetimer*1000)
var oop=this;
setTimeout(function(){
oop.interVeil.style.visibility="visible" //Show veil over page
oop.interContainer.style.visibility="visible" //Show interstitial box
},oop.showdelay);
},

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

ps: thanks for the answers

vwphillips
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

vinautomatic
10-18-2010, 12:27 AM
http://dejesusdriveways.com/test.php

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

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

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

mieketsai
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)

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

can I become an mod now? ;)

vinautomatic
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?

vinautomatic
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 :(