diff options
author | piernov <piernov@piernov.org> | 2016-05-02 20:14:17 +0200 |
---|---|---|
committer | piernov <piernov@piernov.org> | 2016-05-02 20:14:17 +0200 |
commit | cbfbedcaceccda890a7f15cb806561ede72e8044 (patch) | |
tree | 3a6ca1ec1235ad0e73e3bf5f736307a99b77efc4 | |
parent | 035a477c4f30180edecead29e8bcda34a0725881 (diff) | |
download | candybox-cbfbedcaceccda890a7f15cb806561ede72e8044.tar.gz candybox-cbfbedcaceccda890a7f15cb806561ede72e8044.tar.bz2 candybox-cbfbedcaceccda890a7f15cb806561ede72e8044.tar.xz candybox-cbfbedcaceccda890a7f15cb806561ede72e8044.zip |
Allow multiple classes on tabs
-rw-r--r-- | js/gui.js | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -6,10 +6,8 @@ function changeTab() { var id = window.location.hash.substr(4); var tabs = document.querySelectorAll("#tabs-panel > ul > li"); for(var i=0; i < tabs.length; i++) { - if(i == id-1) - tabs[i].className = "active"; - else - tabs[i].className = ""; + if(i == id-1) tabs[i].classList.add("active"); // Doesn't work with IE < 10 (and Opera Mini), but who cares? + else tabs[i].classList.remove("active"); } } |