Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果用户单击外部,我想关闭侧边栏
$( "#menu" ).click(function() { $('.sidebar').sidebar('toggle'); });
http://semantic-ui.com/modules/sidebar.html
$('body').click(function(e){ if($(e.target).prop('id') == 'menu' || $(e.target).hasClass('sidebar')) return false; $('.sidebar').sidebar('toggle'); });