jQuery 调整当前浏览器窗口的大小和位置
如何在 jQuery 的 document.ready()
函数中设置高度、宽度以及设置当前浏览器窗口的位置?
How can I set height, width and set the position of the current browser window in the document.ready()
function of jQuery ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该有两个 JavaScript 函数来调整浏览器窗口大小和移动浏览器窗口:
Chrome 和 Opera 不支持这些函数,其他浏览器也可能会遇到某些安全限制。
如果你想弹出一个特定大小的新窗口,请查看参数
window.open()
。您的界面也不应该完全依赖它,例如您将无法在移动浏览器上执行此操作。当考虑某件事是否可能时,考虑如何滥用它总是一个好的开始。您是否希望屏幕上的窗口每 100 毫秒跳转一次,只是因为某些网站想要这样做?也许这就是为什么它现在不受支持或受到限制的原因。
There supposed to be two javascript functions to resize and move the browser window:
These functions are not supported by Chrome and Opera, and other browsers might experience certain security restrictions as well.
If you want to pop a new window with a certain size, check out the parameters of
window.open()
. Your interface should also not rely on it entirely, for example you won't be able to do it on mobile browsers.When thinking about if something is possible or not it's always a good start to think about ways to abuse it. Would you want windows on your screen to jump around every 100 milliseconds, just because some website wants to do that? Probably that's why it's unsupported or limited these days.