按下按钮的全屏当前页面

时间:2011-06-22 13:19:30

标签: javascript fullscreen

我想使用下面的代码,但是当我点击链接时希望它发生在当前页面上。这可能吗?提前致谢。 :)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Open window to fullscreen without f11</title>
<script type="text/javascript">
function openWin(url){
var sw=screen.width;
var sh=screen.height;
newwin=window.open(url,'newwin','width='+sw+',height='+sh+',top=0,left=0,scrolling=0,toolbar=0,direc tories=0,menubar=0,location=0');
}
</script>
</head>

<body>
<a href="http://www.codingforums.com" onclick="openWin(this.href);return false;">Coding Forums</a>
</body>
</html>

2 个答案:

答案 0 :(得分:0)

您是否尝试过使用window.location.href而不是window.open? window.open用于打开新的浏览器窗口。

答案 1 :(得分:0)

不能在同一个窗口中打开网址和更改CHROME ,你也不应该尝试。

有一个可怕的黑客打开了一个新的窗口并关闭了父母,但更糟糕的是。

USED是一个全屏参数但很幸运地删除了。网页“设计师”无法决定用户窗口的大小,也无法通过关闭主窗口来尝试删除其历史记录。

如果你在这里搜索全屏,你会得到很多,其中包括:

How to make the window full screen with Javascript (stretching all over the screen)