Use Javascript to resize the browser window in IE8. The explanation is mainly

I have seen many examples of using javascript to resize the browser window, but for me they all do not perform this function in IE. I turn on my code to see that something is wrong with it, that I just don’t see. The code works fine in FF, but not used in my location.

I am not an expert in javaScript, but I am not slouched either. If I were new to javaScript, I would hate it. I'm sure this has something to do with IE, but I can't explain it.

Any help would be great.

CODE:

  //window.sizeToContent();
  window.resizeTo(700, 700);

I read in the docs that sizeToContent will not work in IE, but should resize. This is an incredibly simple statement.

+3
source share
5

Internet Explorer 8

<html>
<head>
</head>
<body>
  <h1>Resized</h1>

<script>
  window.resizeTo(400,400);
</script>
</body>

alt text

+2

IE9 beta ( IE, ), , window.resizeTo . , . , , :

setTimeout(function() {
    window.resizeTo(200, 200);
}, 2000);  

( , IE9 beta)

+1

"" IE , .

, . IE8 .

, . window.open onclick, .

+1
source

You cannot reliably resize the window using JavaScript. This is not possible in IE 7 with tabbed browsing enabled. It is also potentially annoying to the user.

0
source

This seems to be just IE.

If your window is a "dialog", for example:

window.showModalDialog(url,...)

I found this hacker way to make it correct:

<script type="text/javascript">
    //window.resizeTo(1000, 790); //Will not work if its a dialog
    window.dialogWidth = '1000px';
    window.dialogHeight = '790px';
</script>
0
source

Source: https://habr.com/ru/post/1770913/


All Articles