AdminLTELogo

Toasts插件

Toasts插件提供简单功能,可以轻松创建一个bootstrap toast。

使用方法

此插件可以作为jQuery插件激活。

jQuery

jQuery API提供了更多可定制的选项,允许开发者处理检查和取消选中待办事项列表复选框的事件。

$(document).Toasts('create', {
  title: 'Toast Title',
  body: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr.'
})
选项
名称 类型 默认 描述
position 字符串 Toast的位置,可用选项: Position of the toast, available options: topRight, topLeft, bottomRight & bottomLeft
fixed 布尔值 true 是否设置toast容器为固定。
autohide 布尔值 false 是否自动隐藏toast
autoremove 布尔值 true 关闭后是否自动移除toast
delay 整数 1000 自动隐藏延迟
fade 布尔值 true 是否淡入淡出toast
icon 字符串 null 图标类(例如:fas fa-exclamation-triangle)
image 字符串 null 图片url
imageAlt 字符串 null 图片替代文本
imageHeight 字符串 ‘25px’ Toast的图片大小
title 字符串 null Toast的标题
subtitle 字符串 null 副标题
close 布尔值 true 是否在toast中添加关闭按钮
body 字符串 null Toast的内容
class 字符串 null Toast的附加类
活动

所有事件都发送到body.

事件类型 描述
init.lte.toasts 构造函数完成时触发
created.lte.toasts Toast创建时触发
removed.lte.toasts Toast移除时触发

示例:$('body').on('created.lte.toast', handleCreateEvent)

方法
方法 描述
create 创建toast

示例:$(document).Toasts('create', {title: 'Toast Title'})

无噪 Logo
无噪文档
中文文档 · 复刻官网
查看所有 ↗