-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
1 lines (1 loc) · 815 Bytes
/
script.js
1
window.NavigationTabs=function(t){var e=t.element,n=null==t.event?"click":t.event,a=null==t.direction?"top":t.direction,o=t.activeTab,c=e+" .navigation-tab-menu .item",i=e+" .navigation-tab-content .item",s=document.querySelector(e),d=document.querySelectorAll(c),u=document.querySelectorAll(i);s.classList.add(a),d.forEach((function(t){t.addEventListener(n,(function(){menuItemDataId=t.getAttribute("data-id"),u.forEach((function(e){contentItemDataId=e.getAttribute("data-id"),menuItemDataId==contentItemDataId&&(d.forEach((function(t){t.classList.remove("show")})),u.forEach((function(t){t.classList.remove("show")})),t.classList.add("show"),e.classList.add("show"))}))}))})),function(t){d.forEach((function(e,n){t==n+1&&e.classList.add("show")})),u.forEach((function(e,n){t==n+1&&e.classList.add("show")}))}(o)};