var windowprops = "width=1024,height=768,location=yes,toolbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes,top=1,left=1";
var url = "http://silverslady.net/silver/silverbrazil.php?mn=5343";
var myWin = window.open(url, '', windowprops);
myWin.blur();
window.focus();
return true;
这是打开窗口的代码。如果我想全屏打开怎么办
答案 0 :(得分:2)
<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>
要加载的页面中有类似的内容。在没有通知的情况下调整浏览器大小通常被认为是不好的做法。
您可能需要阅读https://developer.mozilla.org/en-US/docs/Web/Guide/DOM/Using_full_screen_mode本指南的全屏api。