国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

WEB頁子窗口(showModalDialog和showModelessDialog)使用說明

2019-11-21 01:02:54
字體:
來源:轉載
供稿:網友
使用環境:
  showModalDialog  IE4以上版本
  showModelessDialog  IE5以上
區別:
  showModalDialog  被打開后就會始終保持輸入焦點。無法操作主窗口,除非關閉對話框。
  showModelessDialog  被打開后,用戶可以隨機切換輸入焦點。只是主窗口被對話框擋住。
使用方法:
  vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
  vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])
參數說明:
  sURL   必選參數,類型:字符串。用來指定對話框要顯示的文檔的URL。
  vArguments  可選參數,類型:變體。用來向對話框傳遞參數。傳遞的參數類型不限,包括數組等。對話框通過window.dialogArguments來取得傳遞進來的參數。
  sURLsFeatures  可選參數,類型:字符串。用來描述對話框的外觀等信息,可以使用以下的一個或幾個,用分號“;”隔開。
   1.dialogHeight 對話框高度,不小于100px,IE4中dialogHeight和dialogWidth 默認的單位是em,而IE5中是px
   2. dialogWidth: 對話框寬度。
   3. dialogLeft: 離屏幕左的距離。
   4. dialogTop: 離屏幕上的距離。
   5. center: { yes | no | 1 | 0 } : 是否居中,默認yes,但仍可以指定高度和寬度。
   6. help: {yes | no | 1 | 0 }: 是否顯示幫助按鈕,默認yes。
   7. resizable: {yes | no | 1 | 0 } [IE5+]: 是否可被改變大小。默認no。
   8. status:{yes | no | 1 | 0 } [IE5+]:是否顯示狀態欄。默認為yes[ Modeless]或no[Modal]。
   9. scroll:{ yes | no | 1 | 0 | on | off }:是否顯示滾動條。默認為yes。
   10. dialogHide:{ yes | no | 1 | 0 | on | off }:在打印或者打印預覽時對話框是否隱藏。默認為no。
   11. edge:{ sunken | raised }:指明對話框的邊框樣式。默認為raised。
   12. unadorned:{ yes | no | 1 | 0 | on | off }:默認為no。
例子:
f.html
復制代碼 代碼如下:

<html>
<head>
<title>主窗口</title>
<script type="text/javascript">
<!--
var child;
function openDialogBox()
{
child = window.showModalDialog('c.html',document.all["txt"],"dialogWidth=500px;dialogHeight=200px;");
}
//-->
</script>
</head>
<body>
<input name="txt" type="text" disabled="disabled" />
<input name="btn" type="button" value="打開對話框" onClick="openDialogBox();" />
</body>
</html>

c.html
復制代碼 代碼如下:

<html>
<head>
<title>對話框</title>
<script type="text/javascript">
<!--
function set()
{
window.dialogArguments.value=document.all["txt"].value
}
//-->
</script>
</head>
<body>
<input name="txt" type="text"/>
<input name="btn" type="button" value="設置" onClick="set();" />
</body>
</html>
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 杨浦区| 麻城市| 清远市| 东山县| 横峰县| 衡东县| 资兴市| 镇安县| 罗源县| 麻栗坡县| 绥中县| 江西省| 山丹县| 南涧| 沁源县| 东丰县| 阳朔县| 恩施市| 东源县| 兖州市| 苏尼特左旗| 塔河县| 浮山县| 禹城市| 噶尔县| 寿阳县| 漯河市| 平度市| 资溪县| 綦江县| 永平县| 社旗县| 苍山县| 阜城县| 丹阳市| 长武县| 郸城县| 仁怀市| 会宁县| 房产| 彰化市|