1//ããããã¼ã¸ã¿ãåãæ¿ã 2 3import { elementSelector } from "./elementSelector.js"; 4 5export function tabSwitch(targetTrigger) { 6 const $targets = elementSelector(targetTrigger, "all"); 7 for (let i = 0; i < $targets.length; i++) { 8 $targets[i].addEventListener("click", function () { 9 const tabClass = ".js-tab"; 10 const tabClassWithActive = ".js-tab.active"; 11 const tabContentClass = ".tab-content"; 12 const tabClassWithShow = ".tab-content.show"; 13 const tabs = elementSelector(tabClass, "all"); 14 const tabWithActive = elementSelector(tabClassWithActive, "all"); 15 const tabContents = elementSelector(tabContentClass, "all"); 16 const tabContentsShow = elementSelector(tabClassWithShow, "all"); 17 tabWithActive[0].classList.remove("active"); 18 this.classList.add("active"); 19 tabContentsShow[0].classList.remove("show"); 20 const arrayTabs = Array.prototype.slice.call(tabs); 21 const index = arrayTabs.indexOf(this); 22 tabContents[index].classList.add("show"); 23 }); 24 } 25}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.