http://www.cnblogs.com/libingql/archive/2011/07/17/2109020.html
一、jQueryEasyUI下载地址
http://www.jeasyui.com/
二、jQueryEasyUI Messager基本使用
1、$.messager.alert(title, msg, icon, fn)
1>、基本用法
代码:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<head
runat= "server" >
<title>消息提示框</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
src= "/jquery-easyui-1.2.4/locale/easyui-lang-zh_CN.js" type= "text/javascript" ></script>
<script
type= "text/javascript" >
$( function ()
{
$.messager.alert( "操作提示" ,
"操作成功!" );
});
</script>
</head>
<body>
</body>
</html>
|
效果图:
2>、icon使用
icon四种设置:"error"、"info"、"question"、"warning"
效果:
1
2
3
4
5
|
<script
type= "text/javascript" >
$( function ()
{
$.messager.alert( "操作提示" ,
"操作成功!" , "info" );
});
</script>
|
1
2
3
4
5
|
<script
type= "text/javascript" >
$( function ()
{
$.messager.alert( "操作提示" ,
"操作失败!" , "error" );
});
</script>
|
1
2
3
4
5
|
<script
type= "text/javascript" >
$( function ()
{
$.messager.alert( "操作提示" ,
"您确定要执行操作吗!" , "question" );
});
</script>
|
1
2
3
4
5
|
<script
type= "text/javascript" >
$( function ()
{
$.messager.alert( "操作提示" ,
"您确定要执行操作吗!" , "warning" );
});
</script>
|
3>、function使用
1
2
3
4
5
6
7
8
|
<script
type= "text/javascript" >
$( function ()
{
$.messager.alert( "操作提示" ,
"操作成功!" ,
"info" ,
function ()
{
var i
= 1;
alert(i);
});
});
</script>
|
2、$.messager.confirm(title, msg, fn)
代码:
1
2
3
4
5
6
7
8
9
10
11
12
|
<script
type= "text/javascript" >
$( function ()
{
$.messager.confirm( "操作提示" ,
"您确定要执行操作吗?" ,
function (data)
{
if (data)
{
alert( "确定" );
}
else {
alert( "取消" );
}
});
});
</script>
|
效果图:
3、$.messager.prompt(title, msg, fn)
代码:
1
2
3
4
5
6
7
8
9
|
<script
type= "text/javascript" >
$( function ()
{
$.messager.prompt( "操作提示" ,
"您确定要执行操作吗?" ,
function (data)
{
if (data)
{
alert(data);
}
});
});
</script>
|
效果图:
4、$.messager.show(options)
代码:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<head
runat= "server" >
<title>消息提示框</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
src= "/jquery-easyui-1.2.4/locale/easyui-lang-zh_CN.js" type= "text/javascript" ></script>
<script
type= "text/javascript" >
$( function ()
{
$.messager.show({
title:
"操作提示" ,
msg:
"请选择您要删除的记录!" ,
showType:
'slide' ,
timeout:
5000
});
});
</script>
</head>
<body>
</body>
</html>
|
或
1
2
3
4
5
6
7
8
9
10
11
|
<script
type= "text/javascript" >
$( function ()
{
var options
= {
title:
"操作提示" ,
msg:
"请选择您要删除的记录!" ,
showType:
'slide' ,
timeout:
5000
};
$.messager.show(options);
});
</script>
|
效果图:
showType3种设置值:"show"、"slide"、"fade"
5、修改Button显示文字
代码:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<script
type= "text/javascript" >
$( function ()
{
$.messager.defaults
= { ok: "是" ,
cancel: "否" };
$.messager.confirm( "操作提示" ,
"您确定要执行操作吗?" ,
function (data)
{
if (data)
{
alert( "是" );
}
else {
alert( "否" );
}
});
});
</script>
|
效果图:
6、方法
方法名
|
参数
|
描述
|
$.messager.show
|
options
|
在屏幕的右下角显示一个消息窗口。这些选项的参数可以是一下的一个配置对象:
showType:定义如何将显示消息窗口。可用的值是:null,slide,fade,show。默认值是slide。
showSpeed:定义消息窗口完成的时间(以毫秒为单位), 默认值600。
width:定义消息窗口的宽度。 默认值250。
height:定义消息窗口的高度。 默认值100。
msg:定义显示的消息文本。
title:定义显示在标题面板显示的标题文本。
timeout:如果定义为0,消息窗口将不会关闭,除非用户关闭它。如果定义为非0值,当超时后消息窗口将自动关闭。
|
$.messager.alert
|
title, msg, icon, fn
|
显示一个警告窗口。参数如下:
title:显示在标题面板的标题文本。
msg:提示框显示的消息文本。
icon:提示框显示的图标。可用的值是:error,question,info,warning.
fn:当窗口关闭时触发的回调函数。
|
$.messager.confirm
|
title, msg, fn
|
显示一个含有确定和取消按钮的确认消息窗口。参数如下:
title:显示在标题面板的标题文本。
msg:确认消息窗口显示的消息文本。
fn(b):当用户点击按钮后触发的回调函数,如果点击OK则给回调函数传true,如果点击cancel则传false。
|
$.messager.prompt
|
title, msg, fn
|
显示一个确定和取消按钮的信息提示窗口,提示用户输入一些文本。参数如下:
title:显示在标题面板的标题文本。
msg:提示窗口显示的消息文本。
fn(val):用户点击按钮后的回调函,参数是用户输入的内容。
|
7、扩展
可以通过$.messager.defaults方法自定义alert框的ok按钮和cancel按钮上显示的文字。
名字
|
类型
|
描述
|
默认值
|
|
ok
|
字符串
|
Ok
|
按钮上的文本
|
Ok
|
cancel
|
字符串
|
Cancel
|
按钮上的文本
|
Cancel
|
分享到:
相关推荐
本 chm 文档是根据博客园“风流涕淌”的《jQuery EasyUI 1.2.4 API 中文文档(完整)目录》整理而成 http://www.cnblogs.com/Philoo/archive/2011/11/17/jeasyui_api_index.html Base 基础 Documentation 文档 ...
Jquery EasyUI Demo JQuery EasyUI 例子 包括Accordion、DataGrid、Dialog、LayOut、Messager、Tabs、ValidateBox
easyui dialog和messager样式更改,默认样式太丑
这次依然以BUG修复和功能改进为主,EasyUI发展至今,主体功能已经基本完善。即便以后还有新组件,那也是在现有功能完善的基础上新增一些小组件了,类似Datagrid这类的大型复合组件应该比较少了,相比新组件我更期待...
我个人预计在未来的1~2个版本里会有不少BUG修复的更新内容,今后EasyUI定会发力移动开发方向,所以也算是一个好的开头,虽然目前东西还不是很全,但是基本的也都够用了,希望EasyUI今后会越来越好吧!由于现在工作...
jQuery EasyUI 1.5.1版本更新内容:Bug(修复) datagrid:修复在调用“updateRow”方法之后选中和复选行标志丢失的问题; tabs:修复在调用“update”方法的时候导致标签栏工具错位的问题; window:修复在窗体高度...
修改easyui messager弹框颜色,根据不同弹框类别弹框底色不同,附件中有效果图。
注意:这是MAVEN项目,直接导入Eclipse 到Tomcat服务器访问sendSMS.jsp即可 介绍: 项目是...文章代码的实现,实现了easyui 进度条的功能,感觉很好玩,可以参考一下
jq 消息框,页面底层弹出框插件,jq 消息框,页面底层弹出框插件
jQuery easyUI 培训 教程 1 Accordion(可折叠标签) 2 1.1 实例 2 1.2 参数 3 2 DateBox(日期框) 4 2.1 实例 4 2.2 参数 6 2.3 事件 6 2.4 方法 6 3 ComboBox(组合框) 7 3.1 实例 7 3.2 参数 9 3.3 事件 9 3.4 ...
jQuery EasyUI 1.4.4版本更新内容: Bug(修复) filebox:修复“clear”和“reset”方法在IE9下无法正常工作的问题; messager:修复调用无参的$.messager.progress()方法之后,再调用$.messager.progress('...
jquery.messager.rar v1.5 右下角弹出提示插件 除了chrome,其他浏览器表现都很好,只是chrome差一点而已
本文实例为大家分享了Jquery Easyui进度条组件的实现代码,供大家参考,具体内容如下 加载方式 Class加载 <div class=easyui-progressbar data-options=value:60 xss=removed> JS调用加载 ...
jQuery EasyUI 1.5.1版本更新内容: Bug(修复) datagrid:修复在调用“updateRow”方法之后选中和复选行标志丢失的问题; tabs:修复在调用“update”方法的时候导致标签栏工具错位的问题; window:修复在...
Jquery Messager右下角弹出消息插件
JQuery-easyUI 帮助文档 easyloader.base = '../'; // set the easyui base directory easyloader.load('messager', function(){ // load the specified module $.messager.alert('Title', 'load ok'); });
修改 Easyui提示框显示颜色方法 样式,效果见附件插图