ITPub博客

首页 > IT职业 > IT图书 > jQuery easyui(1)——消息框(message)

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

IT图书 作者:zzzhangyi 时间:2021-09-09 10:00:14 0 删除 编辑

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

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

主要用到的js文件有:

    下面一起看下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");});

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

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3598/viewspace-2814968/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-14

  • 博文量
    133
  • 访问量
    947