Line 22: | Line 22: | ||
}); | }); | ||
− | + | var mul = ul.getElementsByClassName('multiple'); | |
+ | for (var i = 0; i < mul.length; i++) { | ||
+ | var m = mul[i]; | ||
m.addEventListener('click', function () { | m.addEventListener('click', function () { | ||
− | for (var | + | for (var j = 0; j < mul.length; j++) { |
+ | var r = mul[j]; | ||
r.classList.remove('clicked'); | r.classList.remove('clicked'); | ||
} | } | ||
Line 36: | Line 39: | ||
var as = document.getElementById('toc').getElementsByTagName('a'); | var as = document.getElementById('toc').getElementsByTagName('a'); | ||
− | for (var | + | for (var i = 0; i < as.length; i++) { |
+ | var a = as[i]; | ||
a.addEventListener('click', function () { | a.addEventListener('click', function () { | ||
− | for (var | + | for (var j = 0; j < as.length; j++) { |
+ | var oa = as[j]; | ||
oa.classList.remove('active'); | oa.classList.remove('active'); | ||
} | } | ||
Line 59: | Line 64: | ||
var activeA = null; | var activeA = null; | ||
var nextIsActive = false; | var nextIsActive = false; | ||
− | for (var | + | for (var i = 0; i < as.length; i++) { |
+ | var a = as[i]; | ||
a.classList.remove('active'); | a.classList.remove('active'); | ||
− | |||
if (nextIsActive || and(!a.parentElement.classList.contains('toclevel-1'), !activeA)) { | if (nextIsActive || and(!a.parentElement.classList.contains('toclevel-1'), !activeA)) { |
Latest revision as of 17:18, 17 October 2018