jQuery - toastr消息提示插件(取代alter())

时间:2016-07-21 12:21:45   收藏:0   阅读:4698

 

toastr插件详细参考资料

项目地址:https://github.com/CodeSeven/toastr

 

使用方法

(1)添加引用

    <!-- 消息提示 -->
    <link href="/assets/JS/plugins/bootstrap-toastr/toastr.min.css" rel="stylesheet" type="text/css" />
    <!--消息提示-->
    <script type="text/javascript" src="/assets/JS/plugins/bootstrap-toastr/toastr.min.js"></script>

 

(2)常用使用示例

// Display an info toast with no title
toastr.info(‘Are you the 6 fingered man?‘)
// Display a warning toast, with no title
toastr.warning(‘My name is Inigo Montoya. You killed my father, prepare to die!‘)

// Display a success toast, with a title
toastr.success(‘Have fun storming the castle!‘, ‘Miracle Max Says‘)

// Display an error toast, with a title
toastr.error(‘I do not think that word means what you think it means.‘, ‘Inconceivable!‘)

// Immediately remove current toasts without using animation
toastr.remove()

// Remove current toasts using animation
toastr.clear()

// Override global options
toastr.success(‘We do have the Kapua suite available.‘, ‘Turtle Bay Resort‘, {timeOut: 5000})

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!