diff options
Diffstat (limited to 'js/menu-temp.js')
-rw-r--r-- | js/menu-temp.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/js/menu-temp.js b/js/menu-temp.js new file mode 100644 index 0000000..12ec864 --- /dev/null +++ b/js/menu-temp.js @@ -0,0 +1,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); + }); + } + + });
\ No newline at end of file |