/** * rockmodelmsg 模式窗口 * caratename:rainrock * caratetime:2014-05-13 21:40:00 * email:admin@rockoa.com * homepage:www.rockoa.com */ (function ($) { //模式提示 $.rockmodelmsg = function(lx, txt, sj,fun){ clearTimeout($.rockmodelmsgtime); $('#rockmodelmsg').remove(); js.msg('none'); if(!fun)fun=function(){}; if(lx=='none')return; var s = '
'; if(lx=='wait'){ if(!txt)txt='处理中...'; s+='
'; s+='
'+txt+'
'; if(!sj)sj= 60; } if(lx=='ok'){ if(!txt)txt='处理成功'; s+='
'; s+='
'+txt+'
'; } if(lx=='msg' || !lx){ if(!txt)txt='提示'; s+='
'; s+='
'+txt+'
'; } s+='
'; $('body').append(s); if(!sj)sj = 3; var le = (winWb()-$('#rockmodelmsg').width())*0.5; var te = (winHb()-$('#rockmodelmsg').height())*0.5-10; $('#rockmodelmsg').css({'left':''+le+'px','top':''+te+'px'}); $.rockmodelmsgtime = setTimeout(function(){ $('#rockmodelmsg').remove(); fun(); }, sj*1000); } js.msgok = function(msg,fun,sj){ $.rockmodelmsg('ok', msg,sj, fun); }; js.msgerror = function(msg,fun,sj){ $.rockmodelmsg('msg', msg,sj, fun); }; js.loading = function(msg,sj){ $.rockmodelmsg('wait', msg,sj); }; js.unloading= function(){ $.rockmodelmsg('none'); }; })(jQuery);