基于jquery的提示框JavaScript插件,类Bootstrap源码github地址:https://github.com/Ethan-Xie/message示例通过该插件可以给提示栏添加自动/点击消失功能.使用需要引入message.css和message.js添加onclick="$.fn.msg('msg',{text:'warningmessage',type:'warning',position:'middle-center'})”事件函数,可以为元素点击后自动添加提示框功能,可以添加多个次。如果配置为手动关闭,提示框中会出现一个×字符,点击它会从DOM中删除warning警告消息$.fn.msg('msg',{text:'警告消息',type:'warning',position:'top-center'})$.fn.msg或$().msg方法使元素具有提示框功能。如果传入配置sticky:true表示不会自动消失,close:true表示在“×”删除字符后自动添加提示信息,可以传入其他配置:inEffect:{opacity:'show'},//实现方法inEffectDuration:200,//出现过渡时间stayTime:1000,//信息停留时间leaveTime:600,//信息离开动画时间text:'',//提示内容置顶:false,//内容是否为永久界面type:'info',//类型:notice,warning,danger,success,infoposition:'top-center',////top-left,top-center,top-right,middle-left,middle-center,middle-rightclose:false,//是否开启开关功能gmail.comcreatebyxiethanon19.12.17*$().msg(str|object,[object])*概述:该方法可以在网页上调用一个提示框,依赖于jquery*参数:str:文本和提示框等显示的样式设置为默认值*object:设置集合对象:如:{text:'我是测试对象',type:'info',position:'top-center'},其他参数可以在前面一段代码中的text*str,[object]:str是调用库的(msg|removemsg)方法,object:同上例最简单的调用方式:$.fn.msg('Iamtestingstr')调用方法简单,不会自动消失,有关闭按钮:$.fn.msg({text:'我是测试对象',type:'info',position:'top-center',close:true,sticky:true})infogeneralmessage$.fn.msg('msg',{text:'Generalmessage',type:'info',position:'top-center'})notice通知消息$.fn.msg('msg',{text:'通知消息',type:'notice',position:'top-center'})成功消息$.fn.msg('msg',{text:'successmessage',type:'success',position:'top-center'})warning警告消息$.fn.msg('msg',{text:'warningmessage',type:'warning',position:'top-center'})danger危险消息$.fn.msg('msg',{text:'危险信息',type:'危险',位置:'top-center'})IE兼容引入jquery<2.0:support>=IE8源码分析,请阅读src/message.js