(function($){ $(document).ready(function(){ $(document).click(function() { $('body').removeClass('push-right'); }); $('.menu-btn').on('click', function(e){ $('body').toggleClass('push-right'); e.stopPropagation(); // This is the preferred method. return false; // This should not be used unless you do not want // any click events registering inside the div }); }); }(jQuery));