window.resizeTo has no effect - Stack Overflow
滿天的星座
滿天的星座 2017-06-26 10:53:55
0
2
830
<html>
<button onclick="closes()">create</button>
<button onclick="tos()">change</button>

<script>
function closes()
{
    window.open("","myname","width=400, height=400");

}
function tos()
{
    window.resizeTo(700,200);

}
</script>
</html>

window.resizeTo cannot resize the window, what's going on?
Thanks

滿天的星座
滿天的星座

reply all(2)
巴扎黑
var win;
function closes()
{
    win = window.open("","myname","width=400, height=400");

}
function tos()
{
    win.window.resizeTo(700,200);

}
}
阿神

Check out MDN

Learn
Starting from Firefox 7, the size of the browser window cannot be changed. The following rules must be followed:

1. The size of windows or Tabs not created through window.open cannot be set.

2. When a window contains more than one Tab, the window size cannot be set.

That is, the window size that can be changed by resizeTo or resizeBy is only those pages opened with window.open, and the window opened by window.open can only have one tab

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!