Guest User

Untitled

a guest
Oct 17th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. var $tabButtons = $('.products-category-tab'),
  2. $tabs = $('.products-tab');
  3. $tabButtons.click(function () {
  4. if ($(this).hasClass('active')) {
  5. return;
  6. }
  7. var index = $tabButtons.index($(this));
  8. if (index >= 0) {
  9. switchTab(index);
  10. }
  11. });
  12.  
  13. function switchTab(index) {
  14. $tabButtons.removeClass('active').eq(index).addClass('active');
  15. $tabs.removeClass('active').eq(index).addClass('active');
  16. }
Add Comment
Please, Sign In to add comment