Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var $tabButtons = $('.products-category-tab'),
- $tabs = $('.products-tab');
- $tabButtons.click(function () {
- if ($(this).hasClass('active')) {
- return;
- }
- var index = $tabButtons.index($(this));
- if (index >= 0) {
- switchTab(index);
- }
- });
- function switchTab(index) {
- $tabButtons.removeClass('active').eq(index).addClass('active');
- $tabs.removeClass('active').eq(index).addClass('active');
- }
Add Comment
Please, Sign In to add comment