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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts

    window.open() size arguments not working

    I'm trying to pass to a window.open function an argument for the window size (width and height) but the values are not working.

    I debugged using alert(wide) to verify the value (800 in this case) is getting inside the popup function OK but in the window name arguments list, it is not working - it does not set the window width to 800. Do I have to specify the width and height parameters a specific way?

    function popup(mylink, windowname, wide, high)
    {
    alert(wide);
    if (! window.focus)return true;
    var href;
    if (typeof(mylink) == 'string')
    href=mylink;
    else
    href=mylink.href;
    window.open(href, windowname, 'width=wide,height=high,scrollbars=no,location=no,menubar=no,dependent=no,resizable=no,toolbar=no,le ft=100,top=0');
    return false;
    }

    Thanks...
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,950
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Code:
    var w = window.open(href, windowname, 'width=' + wide + ',height=' + high + ',scrollbars=no,location=no,menubar=no,dependent=no,resizable=no,toolbar=no,left=100,top=0');
    w.focus();


  •  

    Posting Permissions

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