]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
add callout about jquery events
authorJohann-S <johann.servoire@gmail.com>
Wed, 31 Jul 2019 20:05:24 +0000 (22:05 +0200)
committerJohann-S <johann.servoire@gmail.com>
Thu, 1 Aug 2019 08:37:27 +0000 (10:37 +0200)
site/content/docs/4.3/getting-started/javascript.md

index d4c00609471ef36bb8746117eb1f5763abfde19d..580e1f25542ff5b0ef13a3396c0c52f902e8a650 100644 (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):