?? 9-1.htm
字號:
<SCRIPT LANGUAGE="JavaScript">
function popupPage(l, t, w, h) {
var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes" +
",left=" + l + ",top=" + t + ",width=" + w + ",height=" + h; <!--設定打開窗口的大小和位置參數,并且打開的窗口中沒有地址欄、滾動欄、菜單欄和工具欄等-->
var URL = "http://www.JavaScript.com/"; <!--將要鏈接到的網頁位置-->
popup = window.open(URL,"MenuPopup",windowprops); <!--使用window對象的open方法按照設定的參數打開對應的網址-->
}
</script>
<table>
<tr>
<td>
<form name=popupform>
<pre>
離開左邊的距離: <input type=text name=left size=2 maxlength=4> pixels
離開右邊的距離: <input type=text name=top size=2 maxlength=4> pixels
窗口的寬度: <input type=text name=width size=2 maxlength=4> pixels
窗口的高度: <input type=text name=height size=2 maxlength=4> pixels
</pre>
<center>
<input type=button value="打開這個窗口!" onClick="popupPage(this.form.left.value, this.form.top.value, this.form.width.value, this.form.height.value)">
</center>
</form>
</td>
</tr>
</table>
<!--本案例實現了按照指定要求打開窗口的操作-->
<!--主要是在窗口大小和位置方面做了一些要求-->
<!--通過window.open()來實現-->
<!--可以在此基礎上擴展更多的可控項-->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -