JavaScript:Window.open函数允许在将可调整大小的属性设置为“0”之后调整窗口的大小。 [英] JavaScript: Window.open function allowing to resize the widow after setting the resizable property as "0"

查看:154
本文介绍了JavaScript:Window.open函数允许在将可调整大小的属性设置为“0”之后调整窗口的大小。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试通过 javascript 调用URL作为弹出窗口 s时,加载pop -up窗口即使在将 resizable 属性设置为0后,我仍然可以通过鼠标拖动重新调整窗口的大小。请参阅下面的代码片段,

 < script type =text / javascript> 
功能poponload()
{
mywindow的= window.open( factory.php?含量= CON1, mywindow的,位置= 1,状态= 1,滚动条= 0,宽度= 300,高度= 300,可调整大小= 0\" );
mywindow.moveTo(150,150);
}
< / script>

请澄清一下,如果我在代码中有任何错误。

解决方案

现代的浏览器可以阻止window.open设置。除非手动转到用户计算机并取消选中复选框,否则无法覆盖它。

在这个时代应该避免弹出窗口。使用Ajax或iframe更新页面上的模态图层可以做同样的事情,并且没有大小,菜单栏和其他限制。


When I try to call a URL as a pop-up windows through javascript, after loading the pop-up window I can able to re-size the window by mouse dragging even after I set the resizable property as "0". Please see the code snippet below,

        <script type="text/javascript">
        function poponload()
        {
            mywindow = window.open("factory.php?content=con1", "mywindow", "location=1,status=1,scrollbars=0,width=300,height=300,resizable=0");
            mywindow.moveTo(150, 150);
        }
    </script>

Please clarify me, if I did any mistake in the code.

解决方案

Modern day browsers can block window.open settings. There are no ways to override it unless you manually go to the user's computer and uncheck the checkbox for them.

Pop up windows should be avoided in this day and age. Modal layers placed on the page that are updated with Ajax or iframes can do the same thing and have no size, menubar, and other restrictions placed on them.

这篇关于JavaScript:Window.open函数允许在将可调整大小的属性设置为“0”之后调整窗口的大小。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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