精品久久久久久亚洲精品_成人午夜网站_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日本高清_亚洲精品久久久久午夜福

      性色av一区二区三区在线观看| 欧美在线在线| 国产精品试看| 欧美国产欧美亚州国产日韩mv天天看完整| 在线一区二区三区四区| 久久综合综合久久综合| 久久综合狠狠综合久久激情| 欧美视频一区在线观看| 国产精品国色综合久久| 亚洲全部视频| 国产日韩欧美不卡| 欧美视频在线免费| 久久精品系列| 一区二区三区久久| 激情综合色综合久久| 久久精品一本| 亚洲综合色视频| 夜夜嗨网站十八久久| 欧美日韩一级大片网址| 亚洲一区二区三区欧美| 国产农村妇女精品一二区| 欧美一区二区三区免费大片| 国产午夜精品在线观看| 久久久久久久国产| 欧美中文字幕| 久久er精品视频| 亚洲欧美国产高清| 亚洲自拍电影| 午夜视频久久久| 亚洲欧美日韩在线不卡| 激情久久久久久久| 影音欧美亚洲| 在线看片日韩| 亚洲日本中文字幕| 亚洲美女啪啪| 制服丝袜亚洲播放| 亚洲一区中文字幕在线观看| 狠狠综合久久| 在线激情影院一区| 亚洲精品免费一区二区三区| 国产伦理一区| 国产一区二区高清| 在线观看中文字幕不卡| 国产精品v一区二区三区| 久久久久久久一区二区| 亚洲一品av免费观看| 尤物网精品视频| 亚洲精品美女在线| 亚洲网在线观看| 香蕉免费一区二区三区在线观看 | 国内不卡一区二区三区| 欧美精品v日韩精品v韩国精品v| 午夜视频在线观看一区二区| 亚洲国产精品999| av成人国产| 久久精品国产久精国产爱| 一区二区av在线| 亚洲国产精品黑人久久久| 国产日韩一区二区三区| 欧美日韩亚洲一区二区三区四区| 久久福利视频导航| 亚洲一区二区三区乱码aⅴ| 亚洲电影毛片| 亚洲欧美精品一区| 久久精品夜色噜噜亚洲aⅴ | 久久福利一区| 欧美精品国产精品日韩精品| 久久久91精品国产| 欧美一区在线视频| 欧美好吊妞视频| 国产综合久久久久久| 国产日本欧美一区二区三区| 国产精品日韩精品欧美在线 | 日韩视频二区| 久久人人看视频| 国产精品视频精品| 99精品欧美一区| 免费在线国产精品| 国产欧美日韩视频一区二区三区| 欧美高清视频免费观看| 欧美大学生性色视频| 免费观看亚洲视频大全| 欧美成年人视频| 韩国一区二区三区美女美女秀| 狠狠爱www人成狠狠爱综合网| 国内精品久久久久影院色 | 亚洲欧美韩国| 欧美日韩在线不卡一区| 欧美特黄一级| 日韩一区二区高清| 欧美福利小视频| 1000部精品久久久久久久久| 亚洲成色www8888| 久久综合狠狠| 亚洲成色精品| 久久欧美中文字幕| 精久久久久久| 乱码第一页成人| 狠狠色狠狠色综合日日五| 91久久线看在观草草青青| 一本一本久久| 欧美日韩色一区| 亚洲无线视频| 国产精品嫩草99av在线| 精品动漫一区| 模特精品裸拍一区| 亚洲黄网站黄| 欧美伦理在线观看| 亚洲一卡久久| 国产一区二区三区不卡在线观看| 亚洲精品免费网站| 欧美手机在线视频| 亚洲欧美一区二区三区极速播放 | 欧美视频日韩视频在线观看| 欧美午夜片在线免费观看| 国产一区白浆| 久久婷婷综合激情| 亚洲精品视频在线观看网站 | 国产精品一二三| 欧美在线首页| 亚洲国产另类久久久精品极度| 亚洲一区二区三区四区在线观看| 久久九九热免费视频| 欧美一区二区三区视频在线观看| 欧美精品自拍偷拍动漫精品| 国内一区二区三区| 欧美欧美天天天天操| 在线观看不卡av| 欧美日韩精品一二三区| 亚洲国产成人不卡| 国产精品久久久久久影视| 一区二区三区高清不卡| 美女精品视频一区| 亚洲一二三区在线| 黄色在线成人| 国产精品入口夜色视频大尺度| 99re6这里只有精品| 欧美电影在线观看完整版| 激情久久久久久| 欧美视频不卡中文| 母乳一区在线观看| 欧美亚洲综合网| 亚洲毛片在线免费观看| 欧美激情视频一区二区三区在线播放 | 久久av资源网| 亚洲天堂成人| 亚洲毛片一区| 在线看国产日韩| 国产欧美综合一区二区三区| 午夜精彩视频在线观看不卡| 欧美激情综合网| 久久久www成人免费精品| 国产视频一区免费看| 久久精品国产清高在天天线| 国产精品xxxxx| 欧美护士18xxxxhd| 麻豆av福利av久久av| 国产综合色一区二区三区 | 国产亚洲欧洲一区高清在线观看| 亚洲欧美日韩国产综合精品二区| 国产精品永久入口久久久| 欧美亚洲一级| 欧美亚洲免费电影| 午夜日本精品| 午夜精品久久久久久久99黑人| 国产午夜精品一区二区三区欧美| 久久久午夜精品| 久久国产精品毛片| 久久久激情视频| 久久福利毛片| 久久亚洲精品欧美| 久久躁狠狠躁夜夜爽| 亚洲午夜激情网站| 亚洲午夜久久久久久久久电影院 | 欧美激情综合亚洲一二区 | 欧美激情视频给我| 免播放器亚洲一区| 狼人社综合社区| 欧美国产第一页| 欧美日韩久久精品| 国产精品爽爽ⅴa在线观看| 久久久久久久久久看片| 99视频国产精品免费观看| 国产日韩欧美高清| 国内精品久久久久影院 日本资源| 欧美成人午夜剧场免费观看| 亚洲剧情一区二区| 亚洲一区二区三区在线观看视频| 在线观看日韩欧美| 亚洲精品一区二区三区福利| 国产一区二区三区四区五区美女| 欧美激情一区二区三区成人 | 欧美承认网站| 欧美日韩在线一区二区| 欧美大片免费看| 欧美日在线观看| 精品成人免费| 一区二区三区四区五区视频 | 欧美精品色综合| 国产欧美日韩|