Skip to content

Instantly share code, notes, and snippets.

@IgorGavrilenko
Last active August 16, 2017 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IgorGavrilenko/b98955e380bad8f65b7f to your computer and use it in GitHub Desktop.
Save IgorGavrilenko/b98955e380bad8f65b7f to your computer and use it in GitHub Desktop.
tabs
$(function() {
var tabs = function (tabsLink, tabsCont, tabsActive) {
$(tabsLink).each(function(a){
$(this).click(function(){
$(tabsCont).removeClass('is-active').eq(a).addClass(tabsActive);
});
});
$(tabsLink).each(function(a){
$(this).click(function(){
$(tabsLink).removeClass(tabsActive);
$(this).addClass(tabsActive);
$(tabsLink).removeClass(tabsActive).eq(a).addClass(tabsActive);
});
});
}
tabs('.staff-tabs__link li', '.staff-tabs__cont > li', 'is-active');
tabs('.age-tabs__link li', '.age-tabs__cont > li', 'is-active');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment