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
  1. #1
    Regular Coder Rappa's Avatar
    Join Date
    Nov 2005
    Location
    LI
    Posts
    356
    Thanks
    21
    Thanked 9 Times in 9 Posts

    height and width

    im trying to get my new window a certain size but nothing im doing is working. I dont know why i cant remember how to do this

    so i got

    <a href="url" target="_blank">name</a>

    i want it to be a certain size when opened
    so i tried

    <a href="url" target="_blank" width="500" height="400">name</a>

    but that didnt work

    and also, how would i center it when opened?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You are no where near the solution.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Size the window</title>
    <script type="text/javascript">
    <!--
    function openWin(url,wid,hgt){
    sw=(screen.width-wid)/2;
    sh=(screen.height-hgt)/2;
    newwin=window.open(url,'newwin','width='+wid+',height='+hgt+',left='+sw+',top='+sh+',scrollbars=0,menubar=0,toolbars=0,status=0');
    newwin.focus();
    }
    //-->
    </script>
    </head>
    
    <body>
    <a href="http://www.codingforums.com" onclick="openWin(this.href,'500','500');return false">Coding Forums</a>
    </body>
    </html>

  • #3
    Regular Coder Rappa's Avatar
    Join Date
    Nov 2005
    Location
    LI
    Posts
    356
    Thanks
    21
    Thanked 9 Times in 9 Posts
    lol thx, pff i was close...


  •  

    Posting Permissions

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