1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Does anyone have a basic popunder script?

Discussion in 'HTML & JavaScript' started by Jared255, Feb 17, 2011.

  1. Jared255

    Jared255 Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    May 10, 2009
    Messages:
    1,907
    Likes Received:
    1,662
    Location:
    Boston, MA
    Hi, I just need a simple popunder script with JS. On click, pop a new window up underneath, resize to full screen.

    I tried to use this - http://www.spiderwebmastertools.com/popunder.html - but it doesn't have the fullscreen option. When I tried to modify it to go fullscreen I couldn't figure it out (I don't know JS).

    Or if someone could help me figure out how to edit this one to make it work that would be fantastic also.

    Code:
    <!-- Auto Popunder created with Spider Webmaster Tools (http://spiderwebmastertools.com). -->
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    var cookie = "Site Name Example";
    
    function popup(){
    if (getcookie(cookie)==""){
    openpopup();
    setcookie();
    }
    }
    
    function openpopup() {
    window.open("example.html","","toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,status=no,width=1,height=1,left=0,top=0").blur(); window.focus();}
    
    function getcookie(cookieName) {
    var id = cookieName + "=";
    var cookievalue = "";
    
    if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(id);
    if (offset != -1) {
    cookievalue = "x";
    }
    }
    return cookievalue;
    }
    
    function setcookie () {
    document.cookie = cookie + "=" + escape ("done");
    }
    //-->
    </SCRIPT>
    
    
    Thanks
     
    Last edited: Feb 17, 2011
  2. Jared255

    Jared255 Jr. Executive VIP Jr. VIP Premium Member

    Joined:
    May 10, 2009
    Messages:
    1,907
    Likes Received:
    1,662
    Location:
    Boston, MA
    Anyone?
     
  3. Cookie Monster

    Cookie Monster Registered Member

    Joined:
    Mar 10, 2011
    Messages:
    67
    Likes Received:
    1
    Location:
    bulbi
    Javascript for the popunder :
    PHP:
    function popthisUnder(url,thewin)
        {
            
    params  'width='+screen.width;
             
    params += ', height='+screen.height/*this and the above line indicate a full screen window*/
            
    params += ', top=0, left=0' /* window position */
            
    params += ', directories=no';
            
    params += ', location=yes';
            
    params += ', menubar=yes';
            
    params += ', resizable=yes';
            
    params += ', scrollbars=yes';
            
    params += ', status=yes';
            
    params += ', toolbar=yes';
            
    params += ', fullscreen=yes';
            
    thewin window.open(url,thewinparams);
            
    thewin.blur();
            
    window.focus()
            return 
    false;
    }
    to autopopunder ...
    HTML:
    <body onload=""popthisUnder('yoururlwithhttp','windowName')"
    else use onclick ...