-
-
Save IgorGavrilenko/b98955e380bad8f65b7f to your computer and use it in GitHub Desktop.
tabs
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
$(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