38 users online (0 members and 38 guests)  

Thread: New Window Size


  Results 1 to 10 of 10

Related

  1. Replies: 2
  2. Window Size    Forum: HTML Forum
    Replies: 1
  3. size a new window with HTML    Forum: HTML Forum
    Replies: 2
  4. Window Size    Forum: HTML Forum
    Replies: 5
  5. Window Size    Forum: Javascript Forum
    Replies: 5
  1. #1
    xanswench's Avatar
    New User

    Status
    Offline
    Join Date
    May 2001
    Location
    Oklahoma City, OK USA
    Posts
    5

    New Window Size

    Hi. Although I know how to code a link to open in its own new window, I can't figure out how to set a specific size for the new window. Please help. Thanks.

  2. #2
    Mr. Blue's Avatar
    Evil twin of Dave

    Status
    Offline
    Join Date
    Jul 2001
    Location
    MA, USA
    Posts
    148
    I'm amateur at this so you may want help from someone else but try putting this first code inbetween your <HEAD> </HEAD> tags

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=400');");
    }
    // End -->
    </script>
    then for each pop up you just do
    Code:
    <a href="javascript:popUp('blah.html')"></a>

  3. #3
    xanswench's Avatar
    New User

    Status
    Offline
    Join Date
    May 2001
    Location
    Oklahoma City, OK USA
    Posts
    5

    Aaaarrrrgggg!

    First off Mr. Blue, I thank you very much for answering me. I can't seem to make it work though. I'm assuming the "smiley face" in the individual popup code is a "p"? And you think you're an amateur, lol.

    I did go searching around and found a nifty script that opens a resizable popup window on mouseover, check it out at:

    http://www.a1javascripts.com/mouseover_scripts/popuponmo/popuponmo.html

    Thanks again ;-)
    Last edited by xanswench; 03-02-2002 at 11:36 PM.

  4. #4
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    This is very similar to one of the last questions I answered...I didn't bother to downloaded the script from the site but this should work right here:

    <script language="javascript">
    <!--
    function popup() {
    var newWindow = window.open("yourpage.html","def","height=300,width=300")
    }
    -->
    </script>

    <a onclick="popup()"> (I haven't tried it out really if that doesn't work add the 'href=yourpage.html' part. Anyways if you've already got it figured out it doesn't matter.

  5. #5
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    I was wrong... I made a few modicifications even though it doesn't matter...

    Code:
    <html>
    <head>
    <script language="javascript"> 
    <!-- 
    function popup() { 
    var newWindow = window.open("yourpage.html","def","height=300,width=300") 
    } 
    --> 
    </script>
    
    </head>
    <body text=black>
    <a href="javascript: location.reload();" onclick="popup()">Click Here!</a>
    </body>
    </html>
    gute'e'day

  6. #6
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Don't forget, Netscape doesn't recognise the resize option in the new window. Usually just gives you a window the same size as the parent window
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  7. #7
    Mr. Blue's Avatar
    Evil twin of Dave

    Status
    Offline
    Join Date
    Jul 2001
    Location
    MA, USA
    Posts
    148
    Sorry for the late reply but the smiley face means ":P"

  8. #8
    xanswench's Avatar
    New User

    Status
    Offline
    Join Date
    May 2001
    Location
    Oklahoma City, OK USA
    Posts
    5

    WOW

    You're all great...thanks a ton!

  9. #9
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    Maybe that netscape problem can be remedied if on 'yourpage.html' you put in the code:

    Code:
    <html>
    <head>
    <script language="javascript">
    <!--
    function resize() {
    var resize = window.resizeBy(300, 300)
    }
    -->
    </script>
    </head>
    <body onload="resize()">
    </body>
    </html>
    Maybe it'll work I just put it together it works with Netscape (sheesh Netscape always causin problems ) so ya. Guess it doesn't hurt to try? haha later

  10. #10
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    gotta love google, they are sending about 30 people a day to this thread lately. I felt that because this page does not link directly to the pop up window maker that I should include a direct link.

    Dave
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting



Tags for this Thread