Created
January 31, 2018 18:27
-
-
Save vlgutv22/b4218b25dacf6876ba2c54829f69da2b to your computer and use it in GitHub Desktop.
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
//js | |
{ | |
function howItWorksTabs() { | |
let item = jQuery('.howItWorksTabs__item'), | |
first = jQuery('.howItWorksTabs__item').first().attr('data-tab'); | |
if (item) { | |
addActive(first, item); | |
item.click(function() { | |
var index = jQuery(this).attr('data-tab'); | |
item.removeClass('active'); | |
addActive(index, item); | |
}); | |
} | |
function addActive(index, item) { | |
item.each(function() { | |
if (jQuery(this).attr('data-tab') === index) { | |
jQuery(this).addClass('active'); | |
} | |
}); | |
} | |
} | |
window.howItWorksTabs = howItWorksTabs; | |
} | |
//js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment