Files
faveo/public/lb-faveo/js/original/tabby.js
Sujit Prasad ffa56a43cb update v1.0.7.9 R.C.
This is a Release Candidate. We are still testing.
2016-08-03 20:04:36 +05:30

27 lines
1013 B
JavaScript
Vendored

$(function () {
$('.tabs a, .tabs button').click(function(e) {
e.preventDefault(); // Prevent default link behavior.
var tabID = $(this).attr('data-target'); // Pull the data-target value as the tabID.
$(this).addClass('active').parent().addClass('active'); // Add the .active class to the link and it's parent li (if one exists).
$(this).siblings().removeClass('active'); // Remove the .active class from sibling tab navigation elements.
$(this).parent('li').siblings().removeClass('active').children().removeClass('active'); // Remove the .active class from sibling li elements and their links.
$(tabID).addClass('active'); // Add the .active class to the div with the tab content.
$(tabID).siblings().removeClass('active'); // Remove the .active class from other tab content divs.
});
});
(function($) {
$(function () {
$('body').addClass('js'); // On page load, add the .js class to the <body> element.
});
})(jQuery);