0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-20 17:54:23 +01:00

add callout about jquery events

This commit is contained in:
Johann-S 2019-07-31 22:05:24 +02:00
parent 291bbac519
commit b7a079d808

View File

@ -64,6 +64,19 @@ myModal.addEventListener('show.bs.modal', function (e) {
})
{{< /highlight >}}
{{< callout warning >}}
## jQuery events
Bootstrap detect jQuery only if `jQuery` is present in `window` object. If jQuery is found, Bootstrap will emit events thanks to jQuery event system.
So if you want to listen Bootstrap's events you'll have to use jQuery methods (`.on`, `.one`).
{{< highlight js >}}
$('#myTab a').on('shown.bs.tab', function () {
// do something...
})
{{< /highlight >}}
{{< /callout >}}
## Programmatic API
All constructors accept an optional options object or nothing (which initiates a plugin with its default behavior):