superwei

          導航

          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          統計

          常用鏈接

          留言簿(4)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          Window.ShowModalDialog使用手冊 轉自 leavecd 的 Blog

          基本介紹:
                   showModalDialog()                              (IE 4+ 支持)
                   showModelessDialog()                         (IE 5+ 支持)
                   window.showModalDialog()                 方法用來創建一個顯示HTML內容的模態對話框。
                   window.showModelessDialog()            方法用來創建一個顯示HTML內容的非模態對話框。
          使用方法:
                   vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures])
                   vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures])
          參數說明:
                  sURL                --   必選參數,類型:字符串。用來指定對話框要顯示的文檔的URL。
                  vArguments   --    可選參數,類型:變體。用來向對話框傳遞參數。傳遞的參數類型不限,包括數組等。對話框通過window.dialogArguments來取得傳遞進來的參數。
                  sFeatures       --    可選參數,類型:字符串。用來描述對話框的外觀等信息,可以使用以下的一個或幾個,用分號“;”隔開。
          ----------------
          1.   dialogHeight:   對話框高度,不小于100px
          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。

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


          參數傳遞:
          1.   要想對話框傳遞參數,是通過vArguments來進行傳遞的。類型不限制,對于字符串類型,最大為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("您傳遞的參數為:" + obj.name)
          </script>
          -------------------------------
          2.   可以通過window.returnValue向打開對話框的窗口返回信息,當然也可以是對象。例如:
          ------------------------------
          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 小辭猬 閱讀(242) 評論(0)  編輯  收藏 所屬分類: DoNet

          主站蜘蛛池模板: 松潘县| 博爱县| 唐山市| 古丈县| 湘潭市| 衢州市| 中方县| 乌恰县| 大庆市| 福鼎市| 宜都市| 崇左市| 贵定县| 大英县| 色达县| 龙州县| 五莲县| 麻栗坡县| 贵定县| 襄樊市| 中超| 遂宁市| 蓬莱市| 东乌珠穆沁旗| 夏邑县| 肇源县| 延安市| 南丹县| 五寨县| 四会市| 涿州市| 清远市| 霍林郭勒市| 承德市| 南安市| 新野县| 荣成市| 黄梅县| 化州市| 滨州市| 商丘市|