- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
'use strict';
var menuContainers = document.getElementsByClassName('menu__container');
for (var i = 0; i < menuContainers.length; i++) {
menuContainers[i].getElementsByClassName('menu__current')[0].setAttribute('onclick', 'menuOpen(' + i + ')');
}
//Changing visibility all elements of menu
function menuOpen(i) {
menuContainers[i].getElementsByClassName('menu__item')[0].classList.toggle('menu__item--visible');
menuContainers[i].getElementsByClassName('menu__item')[1].classList.toggle('menu__item--visible');
menuContainers[i].getElementsByClassName('menu__item')[2].classList.toggle('menu__item--visible');
menuContainers[i].getElementsByClassName('menu__item')[3].classList.toggle('menu__item--visible');
}
Fike 30.04.2015 23:42 # −1