jquery - Menu div slideup outside click -
<a class="btn">click me </a> <div class="content"> content </div> $('.btn').click(function(){ $('.content').slidetoggle(); });
fiddle here
working fine , question need slide div.content when click outside .btn button
thanks
try , more usable , simple code, think
$('.btn').click(function(){ $('.content').delay(100).slidedown( function(){ }); }); $('html').click(function(){ if( $('.content').is(':visible') ) { $('.content').slideup(); } });
Comments
Post a Comment