继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

jQuery easyui(1)——消息框(message)

慕田峪9129951
关注TA
已关注
手记 337
粉丝 200
获赞 993

没事学习下jQuery easyui,顺便记录下来,并分享下。当然,初学不免有不当的地方,欢迎大家指正……

   首先了解下jQuery中的消息框,在写jquery代码前,需要做一些准备工作,如:下载jQuery easyui包,解压并将相关的js、css文件引入到html文件,主要用到的css文件有

<link rel="stylesheet" href="../css/easyui.css"type="text/css">

<link rel="stylesheet" href="../css/icon.css" type="text/css">

主要用到的js文件有:

<script type="text/javascript" src="../js/jquery.min.js"></script>

<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>

    下面一起看下jQuery easyui中的一些消息框主要有四种,它们之间都很相似:

$.messager.alert("my message",         //title  消息框标题"this is content...", //msg 消息框内容"info",               // icon 图标,取值:error,question,info,warning.function(){           //消息框关闭后调用的函数   alert("function");});$.messager.show({title:"title",width:600,height:300,msg:"messager.show",showType:"fade", //显示方式:可取的值 null,slide(默认值),fade,showshowSpeed:600,   //显示速度:默认600msstyle:{         //显示的位置    right:'',    bottom:'',    top:0},timeout:3000,        //多长时间后消失,毫秒为单位draggable:true});// 下面两个消息框与message.alert十分相似,只是回调函数有所不同//confirm的回调函数带布尔类型的参数,promp消息框中有文本框 $.messager.confirm(                "this is title",                "this is msg",                function(xx){                          if(xx)                               alert(xx);                           else                               alert(xx);});$.messager.prompt(        "this is title",        "this is msg",        function(content){                 if(content)                    alert(content+" ok");                 else                     alert("cancel");});

    记录并分享,欢迎大家指正……

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP