Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: window size

  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    window size

    ok i have a page that opens another page without the toolbars, however the issue is that i dont know how to make them different sizes, like this page im including here is too small for what is actually on the page. I have to maximize the window. How do i html the code for the size page i want it to be. I hope I am sayong that correct

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Home Certification</title>
    
    
    
    </head>
    
    <script language="JavaScript"> 
    function loadMainWindow() 
    { 
       var win = window.self; 
       win.opener = window.self; 
       var newloc = "http://clas0as21.corp.cox.com/sdchealtop/framework/frameset.asp"; 
       var ih = (window.window.screen.availHeight - 60) - 100; 
       var iw = (window.window.screen.availWidth - 10) - 100; 
       var it = ((window.window.screen.availHeight - 60) - ih) / 2; 
       var il = ((window.window.screen.availWidth - 10) - iw) / 2; 
       var features = 
    "directories=no,menubar=no,location=no,toolbar=no,status=yes,scrollbars=yes*,resizable=yes" 
    + ",width=" + iw + ",height=" + ih + ",top=" + it + ",left=" + il + ""; 
       v1 = new Date(); 
       v2 = Date.parse(v1); 
       v3 = "pg" + v2; 
       var oNewWindow = window.open(newloc, v3, features); 
       oNewWindow.focus(); 
       win.close(); 
    
    
    } 
    
    
    function window.onload() 
    { 
       try 
       { 
          loadMainWindow(); 
       } 
       catch(e) 
       { 
          popUpMessage.style.display = 'You Are Being Redirected!'; 
       } 
    
    } 
    
    
    </script>

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Well based on this:
    Code:
    var features = 
    "directories=no,menubar=no,location=no,toolbar=no,status=yes,scrollbars=yes*,resizable=yes" 
    + ",width=" + iw + ",height=" + ih + ",top=" + it + ",left=" + il + "";
    It looks like height, width, and screen position is determined just with a mathematical function based on this part of the code:
    Code:
       var ih = (window.window.screen.availHeight - 60) - 100; 
       var iw = (window.window.screen.availWidth - 10) - 100; 
       var it = ((window.window.screen.availHeight - 60) - ih) / 2; 
       var il = ((window.window.screen.availWidth - 10) - iw) / 2;
    Try altering the values in red and see if your results improve. It looks like those two sections control the window size and the other two sections control the window placement on the screen.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #3
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    unfortunatley neither worked. i tried to mess withte section below and when i did it put the window way to big my screen res is 1680 x 1050 and i had:

    Code:
    var features = 
    "directories=no,menubar=no,location=no,toolbar=no,status=yes,scrollbars=yes*,resizable=yes" 
    + ",width=900" + iw + ",height=600" + ih + ",top=" + it + ",left=" + il + "";
    so then i went to the other section and it did nothing,


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •