From: Johann-S Date: Wed, 31 Jul 2019 20:05:24 +0000 (+0200) Subject: add callout about jquery events X-Git-Tag: v5.0.0-alpha1~884 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7a079d808d6b14d90b37fa16418de287209cd53;p=thirdparty%2Fbootstrap.git add callout about jquery events --- 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):