37 users online (1 members and 36 guests)  


  Results 1 to 2 of 2

Related

  1. Replies: 1
  2. Need html text script help    Forum: HTML Forum
    Replies: 2
  3. HTML <DIV></DIV> Resizing Script    Forum: HTML Forum
    Replies: 2
  4. Replies: 1
  1. #1
    X_X_ROB_X_X's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2007
    Posts
    3

    Question Please help me with my html script. Can this be done?

    I have a full sized popunder window for a simple redirect script. I use this to show off other sites in development when taking them to the main one.
    Problem is I want multiple popunders instead of just one. Is it possible to have multiple popunders load in a series underneath the main page?
    Can someone please show me what needs to be changed in this example script for this to happen please? Thank you very much.

    <html>
    <head>
    <SCRIPT LANGUAGE='JAVASCRIPT' TYPE='TEXT/JAVASCRIPT'>
    <!--
    var popupWindow=null;
    function popup(mypage,myname,w,h,pos,infocus){
    if (pos == 'random')
    {LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    else
    {LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
    settings='width='+ w + ',height='+ h + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';popupWindow=window.open('',myname,settings);
    if(infocus=='front'){popupWindow.focus();popupWindow.location=mypage;}
    if(infocus=='back'){popupWindow.blur();popupWindow.location=mypage;popupWindow.blur();}
    }
    // -->
    </script>

    <meta http-equiv="REFRESH" content="0;url=http://www.main-page.com">
    </HEAD>
    <body onLoad="popup('http://www.pop-under.html','pagename','999','999','center','back');">

    </body>
    </HTML>

  2. #2
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Please help me with my html script. Can this be done?

    Hi there X_X_ROB_X_X,

    and a warm welcome to these forums.

    try it like this...
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <script type='text/javascript'>
    
       var mywindow=null;
    
       var pus=3; /* this is the number of popups required*/
    
       var mypage=[
           'http://www.google.com/',
           'http://www.w3schools.com/',
           'http://www.yahoo.com/']; /* the links must be equal to the number of popups*/
    
    window.onload=function() {
        popup('pagename','500','400','random','back');
     }
    function popup(myname,w,h,pos,infocus){
    for(c=0;c<pus;c++) {
    if(pos=='random'){
       l=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
       t=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
     }
    else {
       l=(screen.width)?(screen.width-w)/2:100;
       t=(screen.height)?(screen.height-h)/2:100;
     }
    settings='width='+w+',height='+h+',top='+t+',left='+l+',scrollbars=yes,location=yes,directories=yes,status=yes,menubar=yes,toolbar=yes,resizable=yes';
    
       mywindow=window.open('',myname+c,settings);
    if(infocus=='front'){
       mywindow.location=mypage[c];
       mywindow.focus();
     }
    if(infocus=='back'){
       mywindow.location=mypage[c];
       mywindow.blur();
       }
      }
     }
    </script>
    
    </head>
    <body>
    
    <div></div>
    
    </body>
    </html>
    



Tags for this Thread