Skip to content

Instantly share code, notes, and snippets.

@app06 app06/js-tabs
Created Feb 27, 2018

Embed
What would you like to do?
// tabs
$('.controls').on('click', '.controls__link', function(e) {
e.preventDefault();
var
item = $(this).closest('.controls__item'),
content = $('.content__item'),
itemIdx = item.index();
content.eq(itemIdx)
.add(item)
.addClass('active')
.siblings()
.removeClass('active');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.