如何在JavaScript中显示全屏弹出窗口? [英] How to show fullscreen popup window in javascript?

查看:122
本文介绍了如何在JavaScript中显示全屏弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让弹出式窗口在打开后立即最大化?如果不是这样,至少使它成为屏幕大小?这:

  window.open(src,'newWin','fullscreen =yes')
code>

显然只适用于旧版IE。

解决方案使用 screen.availWidth screen.availHeight 来计算合适的高度尺寸和宽度参数在 window.open()



虽然这可能很接近,但它不会被最大化,对每个人都不准确,特别是如果显示所有工具栏。


Is there a way to make a popup window maximised as soon as it is opened? If not that, at least make it screen-sized? This:

window.open(src, 'newWin', 'fullscreen="yes"')

apparently only worked for old version of IE.

解决方案

Use screen.availWidth and screen.availHeight to calculate a suitable size for the height and width parameters in window.open()

Although this is likely to be close, it will not be maximised, nor accurate for everyone, especially if all the toolbars are shown.

这篇关于如何在JavaScript中显示全屏弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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