aboutsummaryrefslogtreecommitdiff
path: root/site/content/docs/4.3/getting-started/javascript.md
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2019-07-31 22:05:24 +0200
committerJohann-S <[email protected]>2019-08-01 10:37:27 +0200
commitb7a079d808d6b14d90b37fa16418de287209cd53 (patch)
tree1c75c458c709027f8e5e750f06e3eba75b2a91db /site/content/docs/4.3/getting-started/javascript.md
parent291bbac5194c47c34c54de5c54d9a792004922e7 (diff)
downloadbootstrap-b7a079d808d6b14d90b37fa16418de287209cd53.tar.xz
bootstrap-b7a079d808d6b14d90b37fa16418de287209cd53.zip
add callout about jquery events
Diffstat (limited to 'site/content/docs/4.3/getting-started/javascript.md')
-rw-r--r--site/content/docs/4.3/getting-started/javascript.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/site/content/docs/4.3/getting-started/javascript.md b/site/content/docs/4.3/getting-started/javascript.md
index d4c006094..580e1f255 100644
--- a/site/content/docs/4.3/getting-started/javascript.md
+++ b/site/content/docs/4.3/getting-started/javascript.md
@@ -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):