使用按鈕控制以何種方式打開新窗口的屬性介紹
更新時(shí)間:2012年12月17日 11:21:25 作者:
在用戶體驗(yàn)過程中可能會出現(xiàn)這樣的情況:自定義打開新窗口的樣式,本文將介紹詳細(xì)的解決方法,需要了解的朋友可以參考下
<!-- 把下面代碼放到<body>區(qū)域中 -->
<form>
<div align="left">
<input type="button" Value="打開新窗口"
ONCLICK="window.open('index.htm','Sample','toolbar=yes,location=no,directories=no,status=no,menubar=yes,
scrollbars=no,resizable=no,copyhistory=yes,width=300,height=200,left=100,top=100')">
</form>
<!--說明:將其中的鏈接文件test.htm改為你的路徑,窗口參數(shù)如下:
toolbar=yes, 顯示工具條
location=yes,顯示網(wǎng)址欄
directories=no,導(dǎo)航條
status=no,狀態(tài)條
menubar=yes,菜單
scrollbars=yes,滾動條
resizable=no,是否可以改變大小
copyhistory=yes,歷史按鈕
width=300,寬
height=200'高
left=100,距離左邊100
top=100,距離頂端100-->
復(fù)制代碼 代碼如下:
<form>
<div align="left">
<input type="button" Value="打開新窗口"
ONCLICK="window.open('index.htm','Sample','toolbar=yes,location=no,directories=no,status=no,menubar=yes,
scrollbars=no,resizable=no,copyhistory=yes,width=300,height=200,left=100,top=100')">
</form>
<!--說明:將其中的鏈接文件test.htm改為你的路徑,窗口參數(shù)如下:
toolbar=yes, 顯示工具條
location=yes,顯示網(wǎng)址欄
directories=no,導(dǎo)航條
status=no,狀態(tài)條
menubar=yes,菜單
scrollbars=yes,滾動條
resizable=no,是否可以改變大小
copyhistory=yes,歷史按鈕
width=300,寬
height=200'高
left=100,距離左邊100
top=100,距離頂端100-->
相關(guān)文章
Javascript實(shí)例教程(19) 使用HoTMetal(7)
Javascript實(shí)例教程(19) 使用HoTMetal(7)...2006-12-12
document.getElementBy("id")與$("#id")有什么區(qū)
有朋友問document.getElementBy("id")與$("#id")的區(qū)別,其實(shí)第一個(gè)就是js中獲取對象的方法, 第二個(gè)是通過自定義函數(shù)方便調(diào)用,而第三個(gè)是jquery中獲取id對象的方法2013-09-09
Javascript call和apply區(qū)別及使用方法
JavaScript中通過call或者apply用來代替另一個(gè)對象調(diào)用一個(gè)方法,將一個(gè)函數(shù)的對象上下文從初始的上下文改變?yōu)橛?thisObj 指定的新對象2013-11-11

