Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.   var open = false;
  3.  
  4.   $('a#menu').click(function(){
  5.     if(open)
  6.     {
  7.       $('div.nav-mobile-menu').animate({'top': '100%'}, 400);
  8.     }
  9.     else
  10.     {
  11.       $('div.nav-mobile-menu').animate({'top': 0}, 400);
  12.     }
  13.  
  14.     open = !open;
  15.   });
  16.  
  17.   var btn = $('#menu');
  18.  
  19.   btn.on('click', function() {
  20.     $($('.btn')).toggleClass('active');
  21.     $($('.btn')).toggleClass('not-active');
  22.   });
  23.  
  24.   $('div.item').click(function(){
  25.     if($(this).attr('id') == undefined)
  26.     {
  27.       return;
  28.     }
  29.  
  30.     if($(this).attr('id') == 'back')
  31.     {
  32.       $('div.box').css({'left': '-100%'});
  33.       $('div.box#main').animate({'left': 0}, 400);
  34.     }
  35.     else
  36.     {
  37.       $('div.box').css({'left': '100%'});
  38.       $('div.box#' + $(this).attr('id')).animate({'left': 0}, 400);
  39.     }
  40.   });
  41. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement