0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-30 22:52:24 +01:00

Improve docs on Modals, Alerts, Offcanvas and Toasts close triggers examples (#38182)

* Improve docs on Modals, Alerts, Offcanvas and Toasts close triggers examples

* Update site/layouts/shortcodes/js-dismiss.html

Co-authored-by: Julien Déramond <juderamond@gmail.com>

---------

Co-authored-by: Mark Otto <markdotto@gmail.com>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
This commit is contained in:
Hannah Issermann 2023-03-10 18:23:59 +01:00 committed by GitHub
parent 25579aad7c
commit fd7cfac4cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,13 +2,13 @@
{{- $name := .Get 0 -}}
Dismissal can be achieved with the `data` attribute on a button **within the {{ $name }}** as demonstrated below:
Dismissal can be achieved with the `data-bs-dismiss` attribute on a button **within the {{ $name }}** as demonstrated below:
```html
<button type="button" class="btn-close" data-bs-dismiss="{{ $name }}" aria-label="Close"></button>
```
or on a button **outside the {{ $name }}** using the `data-bs-target` as demonstrated below:
or on a button **outside the {{ $name }}** using the additional `data-bs-target` as demonstrated below:
```html
<button type="button" class="btn-close" data-bs-dismiss="{{ $name }}" data-bs-target="#my-{{ $name }}" aria-label="Close"></button>