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();   } }); 

demo


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -