dojo 模态框 修改模态框的属性

闲话没有,上代码:

 1 <html>
2 <head>
3 <title>Dialog</title>
4 <style type="text/css">
5 @import "dojo/resources/dojo.css";
6 @import "dijit/themes/tundra/tundra.css";
7
8 </style>
9 <script type="text/javascript"
10 djConfig="parseOnLoad: true, isDebug: true"
11 src="dojo/dojo.js"></script>
12 <script type="text/javascript">
13 dojo.require("dijit.Dialog");
14 function showModalDialog(funOK,funCancel,args){
15 dijit.byId("divDialog").attr("title",args.title); //根据传进来的参数设定题头
16 dijit.byId("divDialog").attr("class",args.style); //根据传进来的参数设定样式
17
18 dijit.byId("divDialog").show();
19 //绑定事件
20 var divMDOK = dojo.byId("divDialog_btnOK");
21 var divMDCancel = dojo.byId("divDialog_btnCancel");
22 dojo.connect(divMDOK,"click",funOK)
23 dojo.connect(divMDCancel,"click",funCancel)
24
25
26 }
27
28
29 function funOK(){
30 //dijit.byId("divDialog").hide();
31 alert("OK")
32 }
33 function funCancel(){
34 alert("cancel")
35 }
36
37 </script>
38 <style>
39 .dijitDialogUnderlay {
40 background: #666666;
41 opacity: 0.5;
42 }
43 .cssModalD {
44 width:200px;
45 height:100px;
46 text-align:center
47 }
48
49 </style>
50 </head>
51 <body class="tundra">
52 <button id="b1" onClick="showModalDialog('funOK','funCancel',
{title:'ceshi',style:'cssModalD',color:'#FF00DD'})">显示dojo对话框</button> <br>
53
54
55 <div dojoType="dijit.Dialog" id="divDialog" closeNode="hider" title="填写表单">
56
57 <table id="divDialogContent" style=" text-align:center" >
58 <tr>
59 <td colspan="2" style="text-align:center"><label for="name" id="divDialog_info">提示信息 </label></td>
60
61 </tr>
62 <tr>
63 <td><input type="button" value="确定" id="divDialog_btnOK"></td>
64 <td><input type="button" value="取消" id="divDialog_btnCancel"></td>
65 </tr>
66 </table>
67
68 </div>
69 <br>
70 <br>
71
72 <br>
73 测试用。。。。。。。。。。。。。。。
74 </body>
75 </html>
76
77






具体其他功能,研究中。。。

 

你可能感兴趣的:(dojo)