Skip to content

Instantly share code, notes, and snippets.

@mribica
Created May 27, 2013 14:49
Show Gist options
  • Select an option

  • Save mribica/5657459 to your computer and use it in GitHub Desktop.

Select an option

Save mribica/5657459 to your computer and use it in GitHub Desktop.
jquery check if click is outside of defined container
$(document).on 'click', (e) ->
target = $(event.target)
unless target.parents().andSelf().is('#container')
$('#container').hide(500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment