Advertisement
orksnork

Untitled

Nov 11th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var activeTab = ["#tab1", "#tab2", "#tab3", "#tab4", "#tab5", "#tab6", "#tab7", "#tab8"];
  2.  
  3. function pathCheck(v) {
  4.     var pathArray = window.location.pathname.split('/');
  5.     v.forEach(function(t) {
  6.         if (pathArray[pathArray.length] === t) {
  7.             return true;
  8.         }
  9.     });
  10. }
  11. if ($("body").hasClass("page-id-148") && pathCheck(activeTab)) {
  12.     alert(activeTab);
  13.     $(".tab-buttons a").removeClass("active");
  14.     $(this).addClass("active");
  15.     $(".tab-content").hide();
  16.     $(activeTab).show();
  17.     event.preventDefault();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement