Auto-sizing pop-up window?

Discussion in 'JavaScript' started by digitalpoint, Mar 5, 2004.

  1. #1
    I'm sure there must be a way to do it, but I have no clue... Let's say I pop open a window with Javascript, and it displays a table of info that can vary in size both vertically and horizontally.

    Is there a way with Javascript (or anything else) that could auto-size the widow to fit the table?

    - Shawn
     
    digitalpoint, Mar 5, 2004 IP
  2. Mr T

    Mr T Guest

    Messages:
    62
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you able to work out the size of the table? If so, you could just set the window to be big enough.

    This sort of technique.
     
    Mr T, Mar 7, 2004 IP
  3. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #3
    No, the table is variable (not being able to know the size)...

    - Shawn
     
    digitalpoint, Mar 7, 2004 IP
  4. Foxy

    Foxy Chief Natural Foodie

    Messages:
    1,614
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Wouldn't you have to dynamically create the data and then take that info which would need to have a size reference library to give you the dimensions that you could then dynamically place in the code for the window size and then call the window?
     
    Foxy, Mar 9, 2004 IP
  5. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #5
    Doing it that way isn't an option... It needs to be sized after the fact (after the window pops). To give an idea of what it's for, it's within the keyword tracker. When you have the option to show surrounding URLs and a manual query opens the pop-up window showing the various URLs.

    Not mission critical, but it would be nice I think...

    - Shawn
     
    digitalpoint, Mar 9, 2004 IP
  6. Foxy

    Foxy Chief Natural Foodie

    Messages:
    1,614
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #6
    MMmmmm

    I've had to many sherbets at lunch!

    I'll think on this one :cool:
     
    Foxy, Mar 9, 2004 IP
  7. TampaDave

    TampaDave Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    This script will resize a window on load, but you'll have to tinker to figure out variable reszing based on content.

    My suggestion would be to go with a fixed window size and then make yout table variable to fill it.

    BTW, one advantage of this is you can open the page witha regualr link, so it won;t get blocked by pop-up blockers.

    <script language="JavaScript">
    <!--
    function opener() {
    window.open('logger.asp','Login','toolbar=no,status=no,scrollbars=no,locatio
    n=no,menubar=no,directories=no,width=500,height=300')}
    -->
    </script>

    </head>

    <body onLoad="opener()">

    TampaDave
     
    TampaDave, Mar 30, 2004 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    Yeah, that's what I'm doing now... sizing it statically with JavaScript. Would just be nice to be able to adjust it after the page loaded somehow.

    - Shawn
     
    digitalpoint, Mar 30, 2004 IP
  9. phrozen_ra

    phrozen_ra Peon

    Messages:
    147
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    
    window.resizeTo(300, 200)
    
    Code (markup):
    that will resize to width 300 and height 200... use it wise ;)
     
    phrozen_ra, Jan 18, 2005 IP
  10. killer2021

    killer2021 Peon

    Messages:
    872
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #10
    lol yup. Good old window.resize to command :)
     
    killer2021, Nov 11, 2008 IP