blob: 12ec864e6477867763795126f386410e55386d0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
$('.menu-btn').on('click', function() {
var elem = $(this),
item = $('.menu__item'),
active = 'is-active',
play = 'menu__item--play';
if ( elem.hasClass(active) ) {
elem.removeClass(active);
$(item.get().reverse()).each(function(i) {
var row = $(this);
setTimeout(function() {
row.removeClass(play);
}, 50*i);
});
}
else {
elem.addClass(active);
item.each(function(i) {
var row = $(this);
setTimeout(function() {
row.addClass(play);
}, 50*i);
});
}
});
|