可能的重复:
如何在Javascript中制作全屏窗口(伸展到整个屏幕) https://stackoverflow.com/questions/1125084/how-to-make-in-javascript-full-screen-windows-stretching-all-over-the-screen
目前我尝试做类似的事情,当您单击全屏按钮时,当前窗口将变为全屏。我尝试使用以下脚本,但它不起作用。关于如何实现这项工作有什么想法吗?
<script type="text/javascript">
window.onload = maxWindow;
function maxWindow() {
window.moveTo(0, 0);
if (document.all) {
top.window.resizeTo(screen.availWidth, screen.availHeight);
}
else if (document.layers || document.getElementById) {
if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
</script>
一些较新的浏览器支持一个新的 API,它可以让你让任何元素占据整个屏幕:
See http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/ http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/了解更多信息,包括使用该功能的 jQuery 插件。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)