Last active
March 4, 2019 15:44
-
-
Save Garconis/15d51bf7cdac6297b7e0eacd73e3ae80 to your computer and use it in GitHub Desktop.
Divi | Show a section that has an ID when the link with that ID is clicked (and hide the others) — good for creating faux tabs and tab content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code for toggle function on product pages | |
jQuery(document).ready(function($) { | |
/* Divi Blurbs as Tabs */ | |
$('.tab-title').each(function () { | |
var section_id = $(this).find("a").attr("href"); | |
$(this).find("a").removeAttr("href"); | |
$(this).click(function() { | |
$(this).siblings().removeClass("active-tab"); | |
$(this).addClass("active-tab"); | |
$('.tab-content').hide(); | |
$(section_id).show(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment