Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var activeTab = ["#tab1", "#tab2", "#tab3", "#tab4", "#tab5", "#tab6", "#tab7", "#tab8"];
- function pathCheck(v) {
- var pathArray = window.location.pathname.split('/');
- v.forEach(function(t) {
- if (pathArray[pathArray.length] === t) {
- return true;
- }
- });
- }
- if ($("body").hasClass("page-id-148") && pathCheck(activeTab)) {
- alert(activeTab);
- $(".tab-buttons a").removeClass("active");
- $(this).addClass("active");
- $(".tab-content").hide();
- $(activeTab).show();
- event.preventDefault();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement