I have a simple requirement that I am struggling with.
Using jquery, I would like to click a link to show a div then be able to click on anywhere BUT the content that is now shown to hide it again.
I have accomplished the first part, I can fadeIn/Out the div by clicking the link. But I am not sure how I could add that instead of only clicking on the link to fade out, it would be that you could click anywhere but the blue content area to fade out.
http://jsfiddle.net/4hchhhcd/2/
So you fade in by clicking the link but fade out by clicking anything but the content that was shown.
$("#clickme").click(function() {
$("#extra").fadeToggle();
});
I've thought of targeting html or document to close but that doesn't work as #clickme is within this.