1:弹出提示窗的使用
(1)屏幕右下弹出提示窗口:
$.messager.show({
title:'My Title',
msg:'Message will be closed after 4 seconds.',
timeout:4000,(可选)
height:150, (可选)
350,(可选)
showType:'show'
});
timeout:number,(定期关闭)
showType:String(弹出的窗口的方式:show,slide,fade)
});
(2)进度条:
var win = $.messager.progress({
title:'Please waiting',
msg:'Loading data...'
});
setTimeout(function(){
$.messager.progress('close');
},mix);
mix:可以为数字(毫秒)或者为返回数字的函数;获取或者设置进度条的方法为:
var value = $('#p').progressbar('getValue');
if (value < 100){
value += Math.floor(Math.random() * 10);
$('#p').progressbar('setValue', value);
}
(3)普通弹出框:
$.messager.alert(title,msg,type);
type:可以省略,取值为:error,info,question,warning.
(4)确认弹出框:
$.messager.confirm('My Title', 'Are you confirm this?', function(r){
if (r){
alert('confirmed:'+r);
location.href = 'http://www.google.com';
}
});
(5)输入弹出框:
$.messager.prompt('My Title', 'Please type something', function(r){
if (r){
alert('you type:'+r);
}
});