From db9f13128f0705affca661bd166d730dec8f4d5b Mon Sep 17 00:00:00 2001 From: Joseph Geis Date: Fri, 25 Sep 2020 11:28:37 -0700 Subject: [PATCH] Example of using jQuery with tab navs --- site/content/docs/5.0/components/navs.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/site/content/docs/5.0/components/navs.md b/site/content/docs/5.0/components/navs.md index a52a11adc8ad..b311b9ab57da 100644 --- a/site/content/docs/5.0/components/navs.md +++ b/site/content/docs/5.0/components/navs.md @@ -521,6 +521,17 @@ You can activate a tab or pill navigation without writing any JavaScript by simp {{< /highlight >}} +### Via jQuery + +Enable tabbable tabs via JavaScript with jQuery: +{{< highlight js >}} +$('#myTab a').on('click', function(e){ + var tabTrigger = new bootstrap.Tab(e.target) + e.preventDefault() + tabTrigger.show() +}) +{{< /highlight >}} + ### Via JavaScript Enable tabbable tabs via JavaScript (each tab needs to be activated individually):