Skip to content

Instantly share code, notes, and snippets.

@renanlara
Created April 28, 2016 12:57
Show Gist options
  • Save renanlara/6d0878879d88f241e3c281cfd6234b04 to your computer and use it in GitHub Desktop.
Save renanlara/6d0878879d88f241e3c281cfd6234b04 to your computer and use it in GitHub Desktop.
Depois eu explico.
$(document).ready(function(){
// Event Click in whatever tag HTML
$( '#section' ).click(function(event){
event.stopPropagation();
$( '.button' ).toggleClass('open');
});
// Function click out and close function up
$( document ).click( function() {
var btn = $( '.button' );
if(btn.hasClass( 'open' )) {
btn.removeClass( 'open' );
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment