I have a floating div that gets displayed, and I want it to be hidden when the user clicks off the div. This would be similar to the .hover() function callback when hovering off an element. Only I want to do this for click.
I tried just setting a click event for the body, which would hide the div, but that gave unexpected results.
Anyone have ideas on how I could easily do this?
Another, possibly simpler, option would be to add a transparent div between the floating DIV and the rest of the page.
A simple click event on the transparent DIV could handle the hiding, and it would avoid the issues you are encountering with the click event.