www.webdeveloper.com
Results 1 to 6 of 6

Thread: Window.open - Have a need to NOT resize

  1. #1
    Join Date
    Dec 2008
    Posts
    34

    Unhappy Window.open - Have a need to NOT resize

    Hello,

    How do I make a window.open method to open an html file and make it NOT resizable. Below is the code I have:

    onclick="window.open('img_1440.html', '','width=600px,height=550px resizable=0');"

    This window is going to be a small popup window and we want to make it not resizable.

    Thanks,
    Ruchir

  2. #2
    Join Date
    Dec 2008
    Location
    Indiana, USA
    Posts
    14
    Looks like you've forgotten the comma between height and resizable. Also, I believe you're incorrectly borrowing from CSS in specifying the units for the height and width ("px").

    Reference: http://www.w3schools.com/htmldom/met_win_open.asp
    Last edited by Kryptonian; 12-29-2008 at 01:58 AM. Reason: Found another problem

  3. #3
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    'width=600,height=550,resizable=0'

    will make the window that size and not resizable provided that your visitor's browser settings don't override that parameter. The entire content of that parameter are suggestions that browsers are not required to follow and so if your visitor has their browser configured to ignore any or all of those options there is nothing you can do about it (for example I have my browser set to open a new tab instead of a new window and so that entire parameter is ignored since the browser is already open to the size I want it to be.
    Stephen

  4. #4
    Join Date
    Dec 2008
    Posts
    34

    Resize issue

    Hello felgall,

    If it is related to brower settings - both on IE and firefox, then this behavior of overriding the suggestions with browser settings should be universally applicable to all websites and not just my web page. Right?

    I tried to access all other websites such as www.cnn.com and www.businessweek.com and they have pop up window opening in my browser and NOT resizable. How come they are okay?

    Thanks,
    Ruchir

  5. #5
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    No pop-ups on either site. Specify a link that causes a pop-up.

    Pop-ups are always resizable in modern browsers.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  6. #6
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    There are NO web pages on the web that open a new window in my browser. My browser is configured to always open such requested pages in a new tab and as such the viewport size is always the same as for the other pages I have open in the browser and is automatically resized if I resize my browser. There is no code at all that any web site can use to change that behaviour. The best any web site can do is to include the parameters for what they want as the third parameter in the window.open call and hope that their visitor hasn't overridden those options with their own choices.
    Stephen

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles