window.resize在firefox chrome中不起作用 [英] window.resize not working in firefox chrome

查看:368
本文介绍了window.resize在firefox chrome中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下html代码来调整浏览器大小

I am using following html code to resize browser size

<body onload="window.resizeTo(700,300)">



.it在Internet Explorer中工作。

但是为什么它不能在FireFox / Chrome中工作



我应该为我的问题尝试什么


.it is working in Internet Explorer.
. But why it is not working in FireFox/Chrome?

What should i try for my problem?

推荐答案

请按照以下代码。

在您要调整大小的页面上

Follow the below code.
At the page which you want to resize
<head>
<script type="text/javascript">

    function myFunction() {
        this.resizeTo(500, 500);
    this.focus();
}

</script>


</head>





在onload事件上调用此函数。



call this function on onload event.

<body  onload="myFunction();">


这篇关于window.resize在firefox chrome中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆