superwei

          導(dǎo)航

          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          統(tǒng)計

          常用鏈接

          留言簿(4)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          Window.ShowModalDialog使用手冊 轉(zhuǎn)自 leavecd 的 Blog

          基本介紹:
                   showModalDialog()                              (IE 4+ 支持)
                   showModelessDialog()                         (IE 5+ 支持)
                   window.showModalDialog()                 方法用來創(chuàng)建一個顯示HTML內(nèi)容的模態(tài)對話框。
                   window.showModelessDialog()            方法用來創(chuàng)建一個顯示HTML內(nèi)容的非模態(tài)對話框。
          使用方法:
                   vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
                   vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])
          參數(shù)說明:
                  sURL                --   必選參數(shù),類型:字符串。用來指定對話框要顯示的文檔的URL。
                  vArguments   --    可選參數(shù),類型:變體。用來向?qū)υ捒騻鬟f參數(shù)。傳遞的參數(shù)類型不限,包括數(shù)組等。對話框通過window.dialogArguments來取得傳遞進(jìn)來的參數(shù)。
                  sFeatures       --    可選參數(shù),類型:字符串。用來描述對話框的外觀等信息,可以使用以下的一個或幾個,用分號“;”隔開。
          ----------------
          1.   dialogHeight:   對話框高度,不小于100px
          2.   dialogWidth:   對話框?qū)挾取?br /> 3.   dialogLeft:    離屏幕左的距離。
          4.   dialogTop:    離屏幕上的距離。
          5.   center:         { yes | no | 1 | 0 } :             是否居中,默認(rèn)yes,但仍可以指定高度和寬度。
          6.   help:            {yes | no | 1 | 0 }:               是否顯示幫助按鈕,默認(rèn)yes。
          7.   resizable:      {yes | no | 1 | 0 } [IE5+]:    是否可被改變大小。默認(rèn)no。
          8.   status:         {yes | no | 1 | 0 } [IE5+]:     是否顯示狀態(tài)欄。默認(rèn)為yes[ Modeless]或no[Modal]。
          9.   scroll:           { yes | no | 1 | 0 | on | off }:是否顯示滾動條。默認(rèn)為yes。

          下面幾個屬性是用在HTA中的,在一般的網(wǎng)頁中一般不使用。
          10.   dialogHide:{ yes | no | 1 | 0 | on | off }:在打印或者打印預(yù)覽時對話框是否隱藏。默認(rèn)為no。
          11.   edge:{ sunken | raised }:指明對話框的邊框樣式。默認(rèn)為raised。
          12.   unadorned:{ yes | no | 1 | 0 | on | off }:默認(rèn)為no。


          參數(shù)傳遞:
          1.   要想對話框傳遞參數(shù),是通過vArguments來進(jìn)行傳遞的。類型不限制,對于字符串類型,最大為4096個字符。也可以傳遞對象,例如:
          -------------------------------
          parent.htm
          <script>
                   var obj = new Object();
                   obj.name="51js";
                   window.showModalDialog("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");
          </script>
          modal.htm
          <script>
                   var obj = window.dialogArguments
                   alert("您傳遞的參數(shù)為:" + obj.name)
          </script>
          -------------------------------
          2.   可以通過window.returnValue向打開對話框的窗口返回信息,當(dāng)然也可以是對象。例如:
          ------------------------------
          parent.htm
          <script>
                   str =window.showModalDialog("modal.htm",,"dialogWidth=200px;dialogHeight=100px");
                   alert(str);
          </script>
          modal.htm
          <script>
                   window.returnValue="http://www.51js.com";
          </script>

          posted on 2008-02-15 10:11 小辭猬 閱讀(239) 評論(0)  編輯  收藏 所屬分類: DoNet

          主站蜘蛛池模板: 酒泉市| 建德市| 嘉义县| 大余县| 平山县| 汤阴县| 尼玛县| 冷水江市| 襄城县| 天全县| 洪江市| 水富县| 边坝县| 上思县| 德化县| 霍邱县| 吉木萨尔县| 呼伦贝尔市| 巴林左旗| 临洮县| 广德县| 疏勒县| 临武县| 泊头市| 黄平县| 鄂温| 漳平市| 仁布县| 镇安县| 鸡西市| 岳阳市| 杂多县| 丹凤县| 阿图什市| 昔阳县| 阳泉市| 花莲县| 八宿县| 田东县| 会同县| 华安县|