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

 

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})

 

posted @ 2016-07-21 11:29  MarlonWang  阅读(646)  评论(0编辑  收藏  举报