Advertisement
Guest User

Untitled

a guest
Sep 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.37 KB | None | 0 0
  1. $(document).bind('mouseup touchend', function(e){
  2.       var container = $('.menu');
  3.       if (!container.is(e.target) // if the target of the click isn't the container...
  4.           && container.has(e.target).length === 0) // ... nor a descendant of the container
  5.       {
  6.           container.removeClass('active');
  7.           $('body').removeClass('no-scroll');
  8.       }
  9.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement