Toasts プラグインは簡単に bootstrap Toast を作成できるシンプルな機能を提供します。
このプラグインは jQuery プラグインとしてアクティブ化できます。
jQuery API は、開発者が ToDo リストのチェックボックスイベントのチェックとアンチェックを処理できるようにする、よりカスタマイズ可能なオプションを提供します。
$(document).Toasts('create', {
title: 'Toast Title',
body: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr.'
})
名前 | 種類 | デフォルト値 | 説明 |
---|---|---|---|
position | 文字列 | Position.TOP_RIGHT | Toast の位置。使用可能なオプション: 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 | 画像の Alt |
imageHeight | 文字列 | ‘25px’ | toast の画像サイズ |
title | 文字列 | null | Toast のタイトル |
subtitle | 文字列 | null | Toast のサブタイトル |
close | ブール値 | true | Toast に閉じるボタンを追加するかどうか |
body | 文字列 | null | Toast の本文 |
class | 文字列 | null | Toast の追加クラス |
すべてのイベントは body
に送信されます。
イベントタイプ | 説明 |
---|---|
init.lte.toasts | コンストラクタの実行時に発生 |
created.lte.toasts | トーストの作成時に発生 |
removed.lte.toasts | トーストの削除時に発生 |
例: $('body').on('created.lte.toast', handleCreateEvent)
メソッド | 説明 |
---|---|
create | トーストを作成 |
例: $(document).Toasts('create', {title: 'トーストのタイトル'})