Created
October 29, 2013 14:50
-
-
Save hfknight/7216085 to your computer and use it in GitHub Desktop.
JS: Close Element by clicking anywhere on page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#element-need-show').click(function(e){ | |
e.stopPropagation(); | |
}); | |
$("#link-for-popup").click(function(e) { | |
e.preventDefault(); | |
e.stopPropagation(); | |
$('#element-need-show').show(); | |
}); | |
$(document).click(function() { | |
$('#element-need-show').hide(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment