精品久久久久久亚洲精品_成人午夜网站_www日本高清_亚洲精品久久久久午夜福

Toasts

Push notifications to your visitors with a toast, a lightweight and easily customizable alert message.

Toasts are lightweight notifications designed to mimic the push notifications that have been popularized by mobile and desktop operating systems. They’re built with flexbox, so they’re easy to align and position.

Overview

Things to know when using the toast plugin:

  • Toasts are opt-in for performance reasons, so you must initialize them yourself.
  • Toasts will automatically hide if you do not specify autohide: false.
The animation effect of this component is dependent on the prefers-reduced-motion media query. See the reduced motion section of our accessibility documentation.

Examples

Basic

To encourage extensible and predictable toasts, we recommend a header and body. Toast headers use display: flex, allowing easy alignment of content thanks to our margin and flexbox utilities.

Toasts are as flexible as you need and have very little required markup. At a minimum, we require a single element to contain your “toasted” content and strongly encourage a dismiss button.

<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
  <div class="toast-header">
    <img src="..." class="rounded me-2" alt="...">
    <strong class="me-auto">Bootstrap</strong>
    <small>11 mins ago</small>
    <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
  </div>
  <div class="toast-body">
    Hello, world! This is a toast message.
  </div>
</div>

Live

Click the button the below to show as toast (positioning with our utilities in the lower right corner) that has been hidden by default with .hide.

<button type="button" class="btn btn-primary" id="liveToastBtn">Show live toast</button>

<div class="position-fixed bottom-0 end-0 p-3" style="z-index: 5">
  <div id="liveToast" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true">
    <div class="toast-header">
      <img src="..." class="rounded me-2" alt="...">
      <strong class="me-auto">Bootstrap</strong>
      <small>11 mins ago</small>
      <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
    </div>
    <div class="toast-body">
      Hello, world! This is a toast message.
    </div>
  </div>
</div>

Translucent

Toasts are slightly translucent, too, so they blend over whatever they might appear over.

<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
  <div class="toast-header">
    <img src="..." class="rounded me-2" alt="...">
    <strong class="me-auto">Bootstrap</strong>
    <small class="text-muted">11 mins ago</small>
    <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
  </div>
  <div class="toast-body">
    Hello, world! This is a toast message.
  </div>
</div>

Stacking

You can stack toasts by wrapping them in a toast container, which will vertically add some spacing.

<div class="toast-container">
  <div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
    <div class="toast-header">
      <img src="..." class="rounded me-2" alt="...">
      <strong class="me-auto">Bootstrap</strong>
      <small class="text-muted">just now</small>
      <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
    </div>
    <div class="toast-body">
      See? Just like this.
    </div>
  </div>

  <div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
    <div class="toast-header">
      <img src="..." class="rounded me-2" alt="...">
      <strong class="me-auto">Bootstrap</strong>
      <small class="text-muted">2 seconds ago</small>
      <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
    </div>
    <div class="toast-body">
      Heads up, toasts will stack automatically
    </div>
  </div>
</div>

Custom content

Customize your toasts by removing sub-components, tweaking with utilities, or adding your own markup. Here we’ve created a simpler toast by removing the default .toast-header, adding a custom hide icon from Bootstrap Icons, and using some flexbox utilities to adjust the layout.

<div class="toast align-items-center" role="alert" aria-live="assertive" aria-atomic="true">
  <div class="d-flex">
    <div class="toast-body">
    Hello, world! This is a toast message.
   </div>
    <button type="button" class="btn-close me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
  </div>
</div>

Alternatively, you can also add additional controls and components to toasts.

<div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
  <div class="toast-body">
    Hello, world! This is a toast message.
    <div class="mt-2 pt-2 border-top">
      <button type="button" class="btn btn-primary btn-sm">Take action</button>
      <button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="toast">Close</button>
    </div>
  </div>
</div>

Color schemes

Building on the above example, you can create different toast color schemes with our color and background utilities. Here we’ve added .bg-primary and .text-white to the .toast, and then added .btn-close-white to our close button. For a crisp edge, we remove the default border with .border-0.

<div class="toast align-items-center text-white bg-primary border-0" role="alert" aria-live="assertive" aria-atomic="true">
  <div class="d-flex">
    <div class="toast-body">
      Hello, world! This is a toast message.
    </div>
    <button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
  </div>
</div>

Placement

Place toasts with custom CSS as you need them. The top right is often used for notifications, as is the top middle. If you’re only ever going to show one toast at a time, put the positioning styles right on the .toast.

Bootstrap 11 mins ago
Hello, world! This is a toast message.
<form>
  <div class="mb-3">
    <label for="selectToastPlacement">Toast placement</label>
    <select class="form-select mt-2" id="selectToastPlacement">
      <option value="" selected>Select a position...</option>
      <option value="top-0 start-0">Top left</option>
      <option value="top-0 start-50 translate-middle-x">Top center</option>
      <option value="top-0 end-0">Top right</option>
      <option value="top-50 start-0 translate-middle-y">Middle left</option>
      <option value="top-50 start-50 translate-middle">Middle center</option>
      <option value="top-50 end-0 translate-middle-y">Middle right</option>
      <option value="bottom-0 start-0">Bottom left</option>
      <option value="bottom-0 start-50 translate-middle-x">Bottom center</option>
      <option value="bottom-0 end-0">Bottom right</option>
    </select>
  </div>
</form>
<div aria-live="polite" aria-atomic="true" class="bg-dark position-relative bd-example-toasts">
  <div class="toast-container position-absolute p-3" id="toastPlacement">
    <div class="toast">
      <div class="toast-header">
        <img src="..." class="rounded me-2" alt="...">
        <strong class="me-auto">Bootstrap</strong>
        <small>11 mins ago</small>
      </div>
      <div class="toast-body">
        Hello, world! This is a toast message.
      </div>
    </div>
  </div>
</div>

For systems that generate more notifications, consider using a wrapping element so they can easily stack.

<div aria-live="polite" aria-atomic="true" class="position-relative">
  <!-- Position it: -->
  <!-- - `.toast-container` for spacing between toasts -->
  <!-- - `.position-absolute`, `top-0` & `end-0` to position the toasts in the upper right corner -->
  <!-- - `.p-3` to prevent the toasts from sticking to the edge of the container  -->
  <div class="toast-container position-absolute top-0 end-0 p-3">

    <!-- Then put toasts within -->
    <div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
      <div class="toast-header">
        <img src="..." class="rounded me-2" alt="...">
        <strong class="me-auto">Bootstrap</strong>
        <small class="text-muted">just now</small>
        <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
      </div>
      <div class="toast-body">
        See? Just like this.
      </div>
    </div>

    <div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
      <div class="toast-header">
        <img src="..." class="rounded me-2" alt="...">
        <strong class="me-auto">Bootstrap</strong>
        <small class="text-muted">2 seconds ago</small>
        <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
      </div>
      <div class="toast-body">
        Heads up, toasts will stack automatically
      </div>
    </div>
  </div>
</div>

You can also get fancy with flexbox utilities to align toasts horizontally and/or vertically.

<!-- Flexbox container for aligning the toasts -->
<div aria-live="polite" aria-atomic="true" class="d-flex justify-content-center align-items-center w-100">

  <!-- Then put toasts within -->
  <div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
    <div class="toast-header">
      <img src="..." class="rounded me-2" alt="...">
      <strong class="me-auto">Bootstrap</strong>
      <small>11 mins ago</small>
      <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
    </div>
    <div class="toast-body">
      Hello, world! This is a toast message.
    </div>
  </div>
</div>

Accessibility

Toasts are intended to be small interruptions to your visitors or users, so to help those with screen readers and similar assistive technologies, you should wrap your toasts in an aria-live region. Changes to live regions (such as injecting/updating a toast component) are automatically announced by screen readers without needing to move the user’s focus or otherwise interrupt the user. Additionally, include aria-atomic="true" to ensure that the entire toast is always announced as a single (atomic) unit, rather than announcing what was changed (which could lead to problems if you only update part of the toast’s content, or if displaying the same toast content at a later point in time). If the information needed is important for the process, e.g. for a list of errors in a form, then use the alert component instead of toast.

Note that the live region needs to be present in the markup before the toast is generated or updated. If you dynamically generate both at the same time and inject them into the page, they will generally not be announced by assistive technologies.

You also need to adapt the role and aria-live level depending on the content. If it’s an important message like an error, use role="alert" aria-live="assertive", otherwise use role="status" aria-live="polite" attributes.

As the content you’re displaying changes, be sure to update the delay timeout to ensure people have enough time to read the toast.

<div class="toast" role="alert" aria-live="polite" aria-atomic="true" data-bs-delay="10000">
  <div role="alert" aria-live="assertive" aria-atomic="true">...</div>
</div>

When using autohide: false, you must add a close button to allow users to dismiss the toast.

<div role="alert" aria-live="assertive" aria-atomic="true" class="toast" data-bs-autohide="false">
  <div class="toast-header">
    <img src="..." class="rounded me-2" alt="...">
    <strong class="me-auto">Bootstrap</strong>
    <small>11 mins ago</small>
    <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
  </div>
  <div class="toast-body">
    Hello, world! This is a toast message.
  </div>
</div>

Sass

Variables

$toast-max-width:                   350px;
$toast-padding-x:                   .75rem;
$toast-padding-y:                   .5rem;
$toast-font-size:                   .875rem;
$toast-color:                       null;
$toast-background-color:            rgba($white, .85);
$toast-border-width:                1px;
$toast-border-color:                rgba(0, 0, 0, .1);
$toast-border-radius:               $border-radius;
$toast-box-shadow:                  $box-shadow;
$toast-spacing:                     $container-padding-x;

$toast-header-color:                $gray-600;
$toast-header-background-color:     rgba($white, .85);
$toast-header-border-color:         rgba(0, 0, 0, .05);

Usage

Initialize toasts via JavaScript:

var toastElList = [].slice.call(document.querySelectorAll('.toast'))
var toastList = toastElList.map(function (toastEl) {
  return new bootstrap.Toast(toastEl, option)
})

Options

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-bs-, as in data-bs-animation="".

Name Type Default Description
animation boolean true Apply a CSS fade transition to the toast
autohide boolean true Auto hide the toast
delay number 5000 Delay hiding the toast (ms)

Methods

Asynchronous methods and transitions

All API methods are asynchronous and start a transition. They return to the caller as soon as the transition is started but before it ends. In addition, a method call on a transitioning component will be ignored.

See our JavaScript documentation for more information.

show

Reveals an element’s toast. Returns to the caller before the toast has actually been shown (i.e. before the shown.bs.toast event occurs). You have to manually call this method, instead your toast won’t show.

toast.show()

hide

Hides an element’s toast. Returns to the caller before the toast has actually been hidden (i.e. before the hidden.bs.toast event occurs). You have to manually call this method if you made autohide to false.

toast.hide()

dispose

Hides an element’s toast. Your toast will remain on the DOM but won’t show anymore.

toast.dispose()

Events

Event type Description
show.bs.toast This event fires immediately when the show instance method is called.
shown.bs.toast This event is fired when the toast has been made visible to the user.
hide.bs.toast This event is fired immediately when the hide instance method has been called.
hidden.bs.toast This event is fired when the toast has finished being hidden from the user.
var myToastEl = document.getElementById('myToast')
myToastEl.addEventListener('hidden.bs.toast', function () {
  // do something...
})
返回頂部
精品久久久久久亚洲精品_成人午夜网站_www日本高清_亚洲精品久久久久午夜福

      9000px;">

          色综合久久中文综合久久97| 精品88久久久久88久久久| 日韩三级伦理片妻子的秘密按摩| 亚洲综合久久久| 欧美日韩国产色站一区二区三区| 日韩国产高清在线| 久久免费精品国产久精品久久久久| 国产成人免费视频网站 | 日韩三级伦理片妻子的秘密按摩| 毛片基地黄久久久久久天堂| 国产欧美日本一区视频| 在线视频你懂得一区| 九九国产精品视频| 亚洲美女区一区| www国产成人免费观看视频 深夜成人网 | 天天综合天天做天天综合| 日韩欧美国产麻豆| 91热门视频在线观看| 免费久久99精品国产| 中文字幕在线播放不卡一区| 欧美日本在线一区| 一本久道中文字幕精品亚洲嫩| 日韩精品一二三| 1024亚洲合集| 国产亚洲人成网站| 日韩欧美一区电影| 欧美日韩一区二区三区四区| 国产成人在线看| 久久99国产精品久久99| 亚洲成人先锋电影| 日韩理论片一区二区| 国产亚洲欧美色| 精品久久久久久最新网址| 欧美色窝79yyyycom| jiyouzz国产精品久久| 国产福利一区二区三区视频在线 | 亚洲国产wwwccc36天堂| 亚洲欧美综合色| 日本一区二区不卡视频| 久久久久久麻豆| 欧美大片在线观看| 日韩欧美一级二级三级 | 欧美日本一区二区三区四区| 成人福利电影精品一区二区在线观看| 奇米精品一区二区三区四区| 亚洲不卡在线观看| 亚洲最大的成人av| 亚洲高清免费观看高清完整版在线观看| 欧美激情综合在线| 国产欧美一区在线| 国产视频一区在线观看| 欧美激情一区二区三区| 国产拍欧美日韩视频二区| 精品国精品自拍自在线| 精品乱码亚洲一区二区不卡| 2024国产精品| 国产欧美一区二区精品性色| 久久久久国产精品人| 国产欧美一区二区三区网站| 欧美韩国日本不卡| 日韩一区在线看| 亚洲国产成人av网| 免费成人在线影院| 国产精品夜夜嗨| 97久久精品人人做人人爽50路| 99re8在线精品视频免费播放| 色狠狠一区二区三区香蕉| 欧美三级中文字幕| 精品欧美久久久| 亚洲国产电影在线观看| 亚洲综合另类小说| 免费xxxx性欧美18vr| 国产精品一区三区| 色94色欧美sute亚洲线路一久| 精品视频1区2区3区| 日韩精品一区二区三区四区视频| 久久精品视频免费| 亚洲一区二区三区免费视频| 奇米一区二区三区| av不卡免费在线观看| 欧美日本一道本| 国产无人区一区二区三区| 一级做a爱片久久| 国产精品一区二区视频| 欧美色视频一区| 国产欧美一区二区三区在线看蜜臀 | 91麻豆精品秘密| 欧美一区二区三区啪啪| 国产精品毛片高清在线完整版| 亚洲图片有声小说| 高清不卡一区二区在线| 欧美日韩aaaaa| 亚洲欧洲无码一区二区三区| 天天亚洲美女在线视频| 不卡在线观看av| 精品国产91乱码一区二区三区| 日韩毛片一二三区| 国产在线精品视频| 7777女厕盗摄久久久| 一区二区三区在线不卡| 国产精品99久久久| 日韩一区二区三免费高清| 亚洲三级在线免费| 成人性生交大片免费看中文网站| 欧美一区二区福利视频| 亚洲综合男人的天堂| 94-欧美-setu| 国产女人水真多18毛片18精品视频| 日韩av一二三| 欧美喷水一区二区| 亚洲国产精品久久人人爱| 91在线观看成人| 中文字幕视频一区| 国产成人精品在线看| 精品久久久三级丝袜| 久久精品国产亚洲a| 欧美老肥妇做.爰bbww视频| 亚洲一区二区三区小说| 日本高清无吗v一区| 综合欧美一区二区三区| 91免费视频观看| 综合在线观看色| 色哟哟一区二区三区| 一区二区久久久| 在线观看av一区| 亚洲国产日产av| 91麻豆精品国产自产在线| 日韩成人一区二区三区在线观看| 欧美人与性动xxxx| 日韩精品国产欧美| 日韩一区二区电影在线| 久久精品国产亚洲a| 久久精品人人做人人爽人人| 丁香六月综合激情| 亚洲欧美偷拍卡通变态| 在线观看日韩电影| 亚洲成av人片在线| 欧美成人精品二区三区99精品| 国产一区二区免费看| 国产精品久久三| 色婷婷综合久久久中文字幕| 香蕉成人啪国产精品视频综合网| 欧美一级片免费看| 国产福利不卡视频| 亚洲欧美激情插| 日韩久久久久久| av亚洲精华国产精华精华| 亚洲成人av一区二区| 精品国产制服丝袜高跟| 91一区二区在线| 理论片日本一区| 亚洲精品中文在线影院| 在线不卡一区二区| 成人午夜在线免费| 日本成人在线电影网| 国产欧美日产一区| 8v天堂国产在线一区二区| 岛国一区二区在线观看| 亚洲成a人片在线不卡一二三区 | 亚洲日本在线天堂| 日韩情涩欧美日韩视频| 成人福利视频网站| 美女免费视频一区| 亚洲日本护士毛茸茸| 欧美电影免费观看高清完整版 | 亚洲18女电影在线观看| 久久久综合网站| 欧美色精品天天在线观看视频| 国内精品伊人久久久久影院对白| 亚洲精品国产无套在线观| 26uuu国产在线精品一区二区| 在线免费观看一区| 不卡av在线免费观看| 久久丁香综合五月国产三级网站| 有码一区二区三区| 亚洲国产精品99久久久久久久久| 欧美日韩性生活| 91久久精品午夜一区二区| 国产乱人伦偷精品视频不卡 | 欧美一区二区三区四区久久| 91玉足脚交白嫩脚丫在线播放| 久久99精品国产.久久久久久| 亚洲电影第三页| 一区二区三区中文字幕| 国产精品视频一二三| 久久久久久毛片| 精品电影一区二区| 日韩午夜在线影院| 91精品国产综合久久久久久| 欧美综合亚洲图片综合区| 91亚洲精品乱码久久久久久蜜桃| 国产乱人伦偷精品视频免下载| 免费成人在线网站| 美女视频黄免费的久久 | 欧美精品自拍偷拍动漫精品| 色网综合在线观看| 欧美做爰猛烈大尺度电影无法无天| 99久久精品免费看国产| av电影一区二区| 91美女在线看|