Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. $(".gn-icon-menu").click(function() {
  2. $(this).toggleClass("on");
  3. });
  4.  
  5. $(document).click(function() {
  6. if ($(".gn-icon-menu").hasClass('on')) {
  7. $(".gn-icon-menu").removeClass('on');
  8. }
  9. });
  10.  
  11. $(".gn-icon-menu").click(function(event) {
  12. event.stopPropagation();
  13. $(this).toggleClass("on");
  14. });
  15.  
  16. $('body').click(function(evt){
  17. if(evt.target.class == ".gn-icon-menu")
  18. return;
  19. $(".gn-icon-menu").removeClass('on')
  20. });
  21.  
  22. $(".gn-icon-menu").click(function(e) {
  23. e.stopPropagation()
  24. $(this).toggleClass("on");
  25. });
  26.  
  27. $("body").not(".gn-icon-menu").click(function() {
  28. $(".gn-icon-menu").removeClass("on");
  29. });
  30.  
  31. $(".gn-icon-menu").click(function(e) {
  32. e.stopPropagation();
  33. $(this).toggleClass("on");
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement