Results 1 to 3 of 3

Thread: resizeTo 2/3

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Location
    USA
    Posts
    95

    resizeTo 2/3

    I want to position the popup in the center of the screen and 2/3 the size of the screen?

    Ive tried this:

    w=Math.round(screen.availheight*2/3);
    h=Math.round(screen.availwidth*2/3);
    t=(screen.availheight/2)-(h/2+5)
    l=(screen.availwidth/2)-(w/2+25)
    resizeTo(w,h)
    moveTo(t,l)

    but it came out about half the width of the screen and almost full hieght. It also was positioned in the lower left with the bottom 1/3 off the screen.

    Thank you

  2. #2
    scoutt
    Guest
    try this
    Code:
    <script> 
    function resize() { 
    window.resizeTo(window.screen.width * 2/3 ,window.screen.height * 2/3 ); 
    } 
    </script>

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Location
    USA
    Posts
    95
    Thank you,
    That got the size but I came up with this to get the positioning in case anyone wants to know:

    h=(window.screen.availHeight * 2/3);
    w=(window.screen.availWidth * 2/3);
    t = (screen.width) ? (screen.width-w)/2 : 0;
    l = (screen.height) ? (screen.height-h)/2 : 0;
    resizeTo(w,h)
    moveTo(t,l)

    Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width