You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
564 B
Smarty
22 lines
564 B
Smarty
|
|
</div><!--END container -->
|
|
<script>
|
|
(function() {
|
|
// On menu click, change "active" state
|
|
var menuEl = document.querySelector('.nav'),
|
|
liEls = menuEl.querySelectorAll('li'),
|
|
parentEl;
|
|
|
|
menuEl.addEventListener('click', function(e) {
|
|
parentEl = e.target.parentNode;
|
|
if (parentEl.nodeName === 'LI') {
|
|
for(var x=0,numLis=liEls.length;x<numLis;x++) {
|
|
if (liEls[x] !== parentEl) liEls[x].className = '';
|
|
else parentEl.className = 'active';
|
|
}
|
|
}
|
|
}, false);
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html> |