闲话没有,上代码:
具体其他功能,研究中。。。<html> <head> <title>Dialog</title> <style type="text/css"> @import "dojo/resources/dojo.css"; @import "dijit/themes/tundra/tundra.css"; </style> <script type="text/javascript" djConfig="parSEOnLoad: true,isDebug: true" src="dojo/dojo.js"></script> <script type="text/javascript"> dojo.require("dijit.Dialog"); function showModalDialog(funOK,funCancel,args){ dijit.byId("divDialog").attr("title",args.title); //根据传进来的参数设定题头 dijit.byId("divDialog").attr("class",args.style); //根据传进来的参数设定样式 dijit.byId("divDialog").show(); //绑定事件 var divMDOK = dojo.byId("divDialog_btnOK"); var divMDCancel = dojo.byId("divDialog_btnCancel"); dojo.connect(divMDOK,"click",funOK) dojo.connect(divMDCancel,funCancel) } function funOK(){ //dijit.byId("divDialog").hide(); alert("OK") } function funCancel(){ alert("cancel") } </script> <style> .dijitDialogUnderlay { background: #666666; opacity: 0.5; } .cssModalD { width:200px; height:100px; text-align:center } </style> </head> <body class="tundra"> <button id="b1" onClick="showModalDialog('funOK','funCancel',{title:'ceshi',style:'cssModalD',color:'#FF00DD'})">显示dojo对话框</button> <br> <div dojoType="dijit.Dialog" id="divDialog" closeNode="hider" title="填写表单"> <table id="divDialogContent" style=" text-align:center" > <tr> <td colspan="2" style="text-align:center"><label for="name" id="divDialog_info">提示信息 </label></td> </tr> <tr> <td><input type="button" value="确定" id="divDialog_btnOK"></td> <td><input type="button" value="取消" id="divDialog_btnCancel"></td> </tr> </table> </div> <br> <br> <br> 测试用。。。。。。。。。。。。。。。 </body> </html>