我想使用下面的代碼,但希望它發生在當前頁面,當我點擊鏈接。這可能嗎?提前致謝。 :)全屏當前頁面按鈕按
<!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