我想使用下面的代码,但希望它发生在当前页面,当我点击链接。这可能吗?提前致谢。 :)全屏当前页面按钮按
<!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>
你能实际上包括你的测试你的问题的结果?如果你尝试这个代码会发生什么?什么是错误信息或者什么是错误的? –
http://jsfiddle.net/YaMNT/ – HAWKES08
很明显,提问者想要在当前窗口中全屏加载新的URL。所显示的代码将试图全屏显示一个新窗口(但不会),而霍克斯希望通过主浏览器窗口 – mplungjan