Last active
June 3, 2017 13:42
-
-
Save GoodNew5/69b548d6e168f99dd89d292235125b72 to your computer and use it in GitHub Desktop.
js__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 tabs(domElement){ | |
var active = 'active'; | |
var content = $('.tab-content__item'); | |
$(domElement).click(function () { | |
var index = $(this).index(); | |
content.eq(index).addClass(active).siblings().removeClass(active); | |
$(this).addClass(active).siblings().removeClass(active); | |
}); | |
} | |
tabs('.tab-links__item'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment