From 604edb85b423b76ef444246ec3aa00ff958a1b51 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 2 Feb 2018 16:52:09 +0530 Subject: Add files via upload --- js/menu-temp.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 js/menu-temp.js (limited to 'js') 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 -- cgit v1.2.3