消息提示是与用户进行交互时必不可少的组件,看腻了浏览器自带的消息提示框以及bootstrap原生的alert组件,可以尝试一下alertify.js这个前端库,他能给你带来耳目一新的感觉。
alertify.js官网地址:http://fabien-d.github.io/alertify.js/
github地址:https://github.com/fabien-d/alertify.js
使用方法:
引入js
<code>/<code>
引入css
<code>
<link>
<link>/<code>
使用默认弹出提示框
<code>// alert dialog
alertify.alert("Message");/<code>
使用默认消息提示框(消息框在右下角弹出)
<code>// standard notification
// setting the wait property to 0 will
// keep the log message until it's clicked
alertify.log("Notification", type, wait);/<code>
alertify.js的最大好处是可以轻松的自定义外观,可以根据自己项目的配色修改相应的css,从而与 您的项目融为一体。有兴趣的朋友可以加个关注,我会不断的介绍各种有趣好玩的前端类库,希望您能在项目中用到。
閱讀更多 程序猿有話說 的文章