SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2002
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    adding a delay to a pop under

    Hello Sitepointers!

    A friend of mine has made me a javascript to show a pop under but I'd like to make the pop under delay for a while to show, to be more exact 10 seconds. I know there's a javascript feature that enables that but I don't have a clue when or how to add this. The script I use, you'll find below...Any help would be very much appreciated.

    ----------------------
    SCRIPT
    ----------------------

    var popunder=new Array()
    popunder[0]="http://www.allesgratis.net/popup.html"

    //specify popunder window features
    //set 1 to enable a particular feature, 0 to disable
    var winfeatures="width=310,height=395,scrollbars=0,resizable=0,toolbar=0,location=0,menubar=0,status=0,directories=0"
    //Pop-under only once per browser session? (0=no, 1=yes)
    //Specifying 0 will cause popunder to load every time page is loaded
    var once_per_session=1
    ///No editing beyond here required/////
    function get_cookie(Name) {
    var search = Name + "="
    var returnvalue = "";
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
    offset += search.length
    // set index of beginning of value
    end = document.cookie.indexOf(";", offset);
    // set index of end of cookie value
    if (end == -1)
    end = document.cookie.length;
    returnvalue=unescape(document.cookie.substring(offset, end))
    }
    }
    return returnvalue;
    }
    function loadornot(){
    if (get_cookie('popunder')==''){
    loadpopunder()
    document.cookie="popunder=yes"
    }
    }
    function loadpopunder(){
    win2=window.open(popunder[Math.floor(Math.random()*(popunder.length))],"",winfeatures)
    win2.blur()
    window.focus()
    }
    if (once_per_session==0)
    loadpopunder()
    else
    loadornot()
    SPACER
    "Oink?"
    Due to lack of interest tomorrow has been cancelled...

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2002
    Location
    Fort Lauderdale
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Near the bottom there are two lines that call loadpopunder(). Change them to this, should work...

    var to_pop = setTimeout("loadpopunder()", 10000);

    www.unpossiblemedia.com - A Fort Lauderdale based multimedia company.

  3. #3
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually your "Friend" copied if from Javascriptkit. The least your friend could do is leave the credits in.

    Here is a link to the original:
    http://www.javascriptkit.com/script/...popunder.shtml

  4. #4
    SHIZA
    Join Date
    Apr 2003
    Location
    Great White North
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i pray to god your site is'nt big because if you got scripts like that running it's gonna be slowwwww


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
  •