The javascript “resizeTo” function not working in Chrome and Opera

前端 未结 3 1887
我寻月下人不归
我寻月下人不归 2020-11-30 14:13

The resizeTo (that allows setting a new height/width value) function works great on Firefox and Internet Explorer and doesn\'t work at all on Chrome and Opera.

Is th

相关标签:
3条回答
  • 2020-11-30 14:57

    Because many webmasters have made a bad use of pop-ups and resizing, some uncompromising browser manufacturers hopelessly just disable these functions. Other more respectful manufacturers leave them as optional.

    0 讨论(0)
  • 2020-11-30 14:58

    On my way it isn't possible to resize the window when it is on top-level. (so not a pop-up)

    And i think that chrome got it right by not allowing top level windows to be resized.

    You can solve it:

    Resizing won't work for top-level tabs, and when you open sample.htm it's opened as a top-level tab. If you instead opened it as a pop-up (for example using window.open with a width and a height set), resizeTo should work.

    0 讨论(0)
  • 2020-11-30 15:03

    No, there isn't another function.

    The resizeTo method is disabled by default in several browsers, and I know that it can also be manually disabled in Firefox.

    It has been widely misused, so most browser vendors feel that it should be disabled, or at least a user controllable option.

    0 讨论(0)
提交回复
热议问题