前面我们介绍过一款基于jQuery,backbone.js和underscore.js的消息提示框架,今天我们介绍另外一款jQuery的消息提示插件 - Noty。使用它能够帮助我们快速创建,警告,提示和错误信息框。大家肯定都使用过缺省的alert('..')代码吧,使用Nody能够创建出漂亮功能更强大的消息提示,希望大家喜欢!
使用非常简答,你导入对应类库,如下:
var n = noty({text: 'Do you want to continue?',type: 'alert',dismissQueue: true,layout: 'center',theme: 'default',buttons: [{addClass: 'btn btn-primary', text: 'Ok', onClick: function($noty) {$noty.close();noty({dismissQueue: true, force: true, layout: layout, theme: 'default', text: 'You clicked "Ok" button', type: 'success'});}},{addClass: 'btn btn-danger', text: 'Cancel', onClick: function($noty) {$noty.close();noty({dismissQueue: true, force: true, layout: layout, theme: 'default', text: 'You clicked "Cancel" button', type: 'error'});}}]});
本地下载 |