jquery easyui dialog

http://www.cnblogs.com/libingql/archive/2011/09/27/2193690.html 

 

<html xmlns= "http://www.w3.org/1999/xhtml" >
<head runat= "server" >
     <title>Dialog</title>
     <link href= "/jquery-easyui-1.2.4/themes/default/easyui.css"   rel= "stylesheet"   type= "text/css"   />
     <link href= "/jquery-easyui-1.2.4/themes/icon.css"   rel= "stylesheet"   type= "text/css"   />
     <script src= "/jquery-easyui-1.2.4/jquery-1.6.4.min.js"   type= "text/javascript" ></script>
     <script src= "/jquery-easyui-1.2.4/jquery.easyui.min.js"   type= "text/javascript" ></script>
     <script type= "text/javascript" >
         $(function () {
             $( '#dlg' ).dialog({
                 title: '对话框' ,
                 iconCls: "icon-edit" ,
                 collapsible: true ,
                 minimizable: true ,
                 maximizable: true ,
                 resizable: true ,
                 width: 300,
                 height: 200,
                 modal: true
             });
         });
     </script>
</head>
<body>
     <div id= "dlg" >
         Content
     </div>
</body>
</html>
复制代码

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<html xmlns= "http://www.w3.org/1999/xhtml" >
<head runat= "server" >
     <title>Dialog</title>
     <link href= "/jquery-easyui-1.2.4/themes/default/easyui.css"   rel= "stylesheet"   type= "text/css"   />
     <link href= "/jquery-easyui-1.2.4/themes/icon.css"   rel= "stylesheet"   type= "text/css"   />
     <script src= "/jquery-easyui-1.2.4/jquery-1.6.4.min.js"   type= "text/javascript" ></script>
     <script src= "/jquery-easyui-1.2.4/jquery.easyui.min.js"   type= "text/javascript" ></script>
</head>
<body>
     <div id= "dlg"   class = "easyui-dialog"   style= "width:300px; height:200px;"   title= "对话框"   iconCls= "icon-edit" >
         Content
     </div>
</body>
</html>
复制代码

效果图:

2、工具栏、按钮栏

代码:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<script type= "text/javascript" >
     $( function   () {
         $( '#dlg' ).dialog({
             title: '对话框' ,
             iconCls: "icon-edit" ,
             collapsible: true ,
             minimizable: true ,
             maximizable: true ,
             resizable: true ,
             width: 300,
             height: 200,
             modal: true ,
             href: "Content.aspx" ,
             onClose: function   () {
                 alert( "Close" );
             },
             toolbar: [{
                 text: 'Add' ,
                 iconCls: 'icon-add' ,
                 handler: function   () {
                     alert( 'add' );
                 }
             }, '-' , {
                 text: 'Save' ,
                 iconCls: 'icon-save' ,
                 handler: function   () {
                     alert( 'save' );
                 }
             }],
             buttons: [{
                 text: 'Ok' ,
                 iconCls: 'icon-ok' ,
                 handler: function   () {
                     alert( 'ok' );
                 }
             }, {
                 text: 'Cancel' ,
                 iconCls: 'icon-cancel' ,
                 handler: function   () {
                     $( '#dlg' ).dialog( 'close' );
                 }
             }]
         });
     });
</script>
复制代码

效果图:


3、参数

属性名

类型

描述

默认值

title

字符串

对话框的标题文本

New Dialog

collapsible

布尔

定义是否显示可折叠按钮

false

minimizable

布尔

定义是否显示最小化按钮

false

maximizable

布尔

定义是否显示最大化按钮

false

resizable

布尔

定义对话框是否可编辑大小

false

toolbar

数组

对话框上的工具条,每个工具条包括:

text,

iconCls,

disabled,

handler

etc.

null

buttons

数组

对话框底部的按钮,每个按钮包括:

text,

iconCls,

handler

etc.

null

4、事件

Dialog的事件和窗口(Window)的事件相同。

5、方法

Dialog的函数方法和窗口(Window)的相同。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值