Results 1 to 2 of 2

Thread: Running two interstatial ads

  1. #1
    Join Date
    Jan 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Running two interstatial ads

    1) Script Title: Interstitial Content Box (v1.1)

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

    3) Describe problem: Firstly I have to commend the author on this script, its fantastic. My "problem" is that I would like to run 2 ads on the site - the first will (and does) open on load, one time per browser session - this works flawlessly. However, I would like to add a second ad which opens after say 2 minutes as a site survey form so that I can gauge users feelings on the site.

    Is this possible? If so how - or is there some other way to achieve this.

    Thanks in advance

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Set everything up as normal for a once per session box. In the configuration set your two pages here:

    Code:
    var interstitialBox={
    //1) list of files on server to randomly pick from and display
    displayfiles: ['samplecontent.htm', 'samplecontent2.htm'],
    Make the first one be the one you want shown onload, the second one the survey.

    Then find these functions and make the highlighted changes:

    Code:
    closeit:function(){
    this.interVeil.style.display="none"
    this.interContainer.style.display="none"
    if (this.disablescrollbars && window.XMLHttpRequest) //if disablescrollbars enabled and modern browsers- IE7, Firefox, Safari, Opera 8+ etc
    this.standardbody.style.overflow="auto"
    if (typeof this.timervar!="undefined") clearTimeout(this.timervar)
    this.ajaxconnect(this.displayfiles[1], this.interContainer);
    },
    Code:
    initialize:function(){
    this.createcontainer() //write out interstitial container
    this.ajaxconnect(this.displayfiles[0], this.interContainer) //load page into content via ajax
    this.dotask(window, function(){interstitialBox.hidescrollbar(); interstitialBox.getscrollbarwidth(); setTimeout("interstitialBox.showcontainer()", 100)}, "load")
    this.dotask(window, function(){interstitialBox.showcontainer()}, "resize")
    }
    At the very end of the script, add this code:

    Code:
    ;(function(box){
    	if(!box.launch){
    		return;
    	}
    	setTimeout(function(){
    		box.hidescrollbar();
    		box.getscrollbarwidth();
    		setTimeout(function(){
    			box.showcontainer();
    			box.interVeil.style.display='';
    			box.interContainer.style.display='';
    			}, 100);
    		}, 60 * 2000);
    })(interstitialBox);
    The above will launch your first one onload, and the second after 2 minutes. Both will only be once per session.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •