diff --git a/lib/tabs.js b/lib/tabs.js index 17f80c7..89c348b 100644 --- a/lib/tabs.js +++ b/lib/tabs.js @@ -7,15 +7,19 @@ define([], function () { var container = document.createElement("div") - function switchTab() { + function gotoTab(li) { for (var i = 0; i < tabs.children.length; i++) { var el = tabs.children[i] el.classList.remove("visible") el.tab.classList.remove("visible") } - this.classList.add("visible") - this.tab.classList.add("visible") + li.classList.add("visible") + li.tab.classList.add("visible") + } + + function switchTab() { + gotoTab(this) return false }