1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-25 14:30:46 +02:00

add a way to disable jQuery detection

This commit is contained in:
Johann-S
2019-08-02 15:51:05 +02:00
parent 1ebb8e7d9b
commit 8b2b490f9b
15 changed files with 92 additions and 27 deletions

View File

@@ -67,7 +67,7 @@ myModal.addEventListener('show.bs.modal', function (e) {
{{< callout warning >}}
## jQuery events
Bootstrap will detect jQuery only if `jQuery` is present in the `window` object. If jQuery is found, Bootstrap will emit events thanks to jQuery's event system. So if you want to listen to Bootstrap's events, you'll have to use the jQuery methods (`.on`, `.one`).
Bootstrap will detect jQuery if `jQuery` is present in the `window` object and no `data-no-jquery` attribute on `<body>`. If jQuery is found, Bootstrap will emit events thanks to jQuery's event system. So if you want to listen to Bootstrap's events, you'll have to use the jQuery methods (`.on`, `.one`) instead of `addEventListener`.
{{< highlight js >}}
$('#myTab a').on('shown.bs.tab', function () {