精品久久久久久亚洲精品_成人午夜网站_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;">

          国产亚洲婷婷免费| 久久中文娱乐网| 不卡高清视频专区| 免费亚洲电影在线| 亚洲第一搞黄网站| 一区二区高清免费观看影视大全| 久久婷婷成人综合色| 日韩欧美中文字幕一区| 欧美日韩国产高清一区二区三区| 色综合天天综合网国产成人综合天| 国产麻豆日韩欧美久久| 美女视频黄免费的久久| 日韩精品高清不卡| 一区二区三区日韩在线观看| 亚洲人xxxx| 亚洲欧美在线视频观看| 专区另类欧美日韩| 国产精品网站一区| 亚洲欧美在线观看| 亚洲三级视频在线观看| 一区二区三区精品在线观看| 一区二区三区四区在线播放| 又紧又大又爽精品一区二区| 一区二区三区免费观看| 五月综合激情日本mⅴ| 蜜臀va亚洲va欧美va天堂| 久久不见久久见免费视频7| 国内精品久久久久影院一蜜桃| 久色婷婷小香蕉久久| 国产一区二区三区久久久| 国产99精品在线观看| 99视频超级精品| 欧美天堂一区二区三区| 日韩久久久精品| 国产调教视频一区| 亚洲男人天堂av| 日日欢夜夜爽一区| 国产精品 欧美精品| 99免费精品在线| 欧美日韩中文一区| 久久这里只精品最新地址| 最新热久久免费视频| 香蕉影视欧美成人| 国产精品影视在线| 91国产丝袜在线播放| 日韩欧美一区电影| 国产精品私房写真福利视频| 亚洲精品视频在线| 麻豆一区二区三区| 91在线无精精品入口| 91麻豆精品国产91久久久| 国产精品久久久久久久午夜片| 一级做a爱片久久| 国产酒店精品激情| 欧美日韩国产天堂| 中文字幕字幕中文在线中不卡视频| 丝袜美腿亚洲一区二区图片| 成人中文字幕在线| 日韩欧美一级精品久久| 一区二区三区四区av| 成人黄色国产精品网站大全在线免费观看 | av福利精品导航| 欧美v日韩v国产v| 一区二区激情小说| 99国产精品久久久久久久久久| 欧美一级一区二区| 亚洲一区二区三区中文字幕| 成人三级在线视频| 精品国产青草久久久久福利| 五月天一区二区三区| 日本丶国产丶欧美色综合| 中文字幕制服丝袜成人av| 精品一区二区三区在线播放视频 | 成人在线视频一区二区| 欧美tickling网站挠脚心| 亚洲国产一区视频| 91麻豆精品一区二区三区| 国产精品毛片久久久久久久| 国产在线日韩欧美| 久久久久久久久久久久电影 | 久久久久久99精品| 精品一区二区三区在线视频| 日韩一级大片在线| 麻豆高清免费国产一区| 欧美大片在线观看一区| 乱中年女人伦av一区二区| 日韩一级片网址| 韩国v欧美v日本v亚洲v| 欧美成人aa大片| 激情综合网av| 久久免费美女视频| 成人免费观看男女羞羞视频| 国产亚洲美州欧州综合国| 国产麻豆视频一区二区| 国产欧美一区二区在线| 成年人国产精品| 亚洲区小说区图片区qvod| 色婷婷av一区二区三区大白胸| 一区二区三区日本| 在线播放欧美女士性生活| 日韩国产一二三区| 日韩一级成人av| 国产suv精品一区二区6| 亚洲女性喷水在线观看一区| 在线看国产一区| 日韩av中文字幕一区二区| 久久综合色之久久综合| 国产91精品露脸国语对白| 亚洲嫩草精品久久| 51久久夜色精品国产麻豆| 国产综合成人久久大片91| 中文字幕一区二区三区在线观看| 在线视频综合导航| 美女网站一区二区| 亚洲色图欧洲色图婷婷| 欧美一级理论性理论a| 国产成人av资源| 亚洲成人综合在线| 久久久精品影视| 欧美日韩日本视频| 国产精品一区二区在线观看网站| ...xxx性欧美| 日韩一区二区在线观看| 色婷婷综合久色| 国产一区二区三区美女| 亚洲成a人片在线不卡一二三区 | 91免费小视频| 久久成人久久鬼色| 亚洲精品免费视频| 国产欧美精品国产国产专区| 91福利区一区二区三区| 国产91丝袜在线观看| 肉丝袜脚交视频一区二区| 1区2区3区精品视频| 欧美r级在线观看| 777亚洲妇女| 日本高清视频一区二区| 成人网男人的天堂| 久久成人综合网| 婷婷亚洲久悠悠色悠在线播放| 国产精品的网站| 国产午夜精品久久久久久免费视| 欧美日韩亚洲不卡| 色欧美片视频在线观看在线视频| 国产一区二区不卡| 喷水一区二区三区| 秋霞午夜鲁丝一区二区老狼| 亚洲国产一区在线观看| 亚洲美女免费在线| 成人欧美一区二区三区视频网页| 国产日韩欧美制服另类| 日韩欧美久久一区| 日韩一级片在线观看| 欧美一区二区三区四区高清| 欧美特级限制片免费在线观看| 91浏览器在线视频| 色哟哟在线观看一区二区三区| 成人禁用看黄a在线| 国产成人综合网| 成人综合在线观看| 99精品欧美一区二区蜜桃免费| 成人国产电影网| 91蜜桃免费观看视频| 成人国产精品免费网站| 91色九色蝌蚪| 欧美日韩精品系列| 在线综合+亚洲+欧美中文字幕| 欧美日韩在线综合| 日韩一区二区三区免费看| 精品久久人人做人人爰| 中文字幕欧美区| 亚洲欧美日韩一区二区| 亚洲伊人伊色伊影伊综合网| 亚洲成人精品一区| 美女免费视频一区| 久久精品二区亚洲w码| 国产精品自在在线| 99re视频这里只有精品| 欧美日韩成人高清| 精品播放一区二区| 日本一区二区高清| 亚洲啪啪综合av一区二区三区| 一区二区视频在线看| 青青国产91久久久久久| 国产乱国产乱300精品| 99精品久久久久久| 555www色欧美视频| 中国色在线观看另类| 亚洲一级二级三级| 韩国欧美国产一区| 色狠狠综合天天综合综合| 精品少妇一区二区三区日产乱码 | 精品系列免费在线观看| 99视频一区二区| 91麻豆精品久久久久蜜臀| 国产欧美日韩精品一区| 亚洲一二三区视频在线观看| 久久99国产精品麻豆| 一本到三区不卡视频| 日韩欧美三级在线|