jquery easyUI提示框的使用


1:彈出提示窗的使用

(1)屏幕右下彈出提示窗口:

   $.messager.show({
    title:'My Title',
    msg:'Message will be closed after 4 seconds.',
    timeout:4000,(可選)
    height:150, (可選)
    width: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);
    }
   });

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章