Skip to content

Instantly share code, notes, and snippets.

@jtulk
Created April 28, 2014 21:44
Show Gist options
  • Save jtulk/11384949 to your computer and use it in GitHub Desktop.
Save jtulk/11384949 to your computer and use it in GitHub Desktop.
Hide Element on Clicking Away
$('body').on "click", ->
//If element to hide is open
$('.elementToHide').hide()
$('.elementToHide').on "click", (e) ->
e.stopPropagation()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment