From b7a079d808d6b14d90b37fa16418de287209cd53 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 31 Jul 2019 22:05:24 +0200 Subject: [PATCH] add callout about jquery events --- site/content/docs/4.3/getting-started/javascript.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/site/content/docs/4.3/getting-started/javascript.md b/site/content/docs/4.3/getting-started/javascript.md index d4c0060947..580e1f2554 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): -- 2.47.2