I found a solution here, on stackoverflow, the script is following:
jQuery(document).mouseup(function (e){
var container = jQuery(".quick-info");
if (container.has(e.target).length === 0) {
container.hide();
}
});
Mine try was:
jQuery('body:has(.quick-info:visible):not(.quick-info)').click(function (e) {
jQuery(".quick-info").hide();
});
So my script means: Catch click which was made on body, but not on .quick-info, and body has .quick-info visible. What might be the problem? May be some wrong selector?
UPDATE 1
Based on Raminson answer.
jQuery('body > *:not(.quick-info)').click(function (e) { var container = jQuery(".quick-info"); if (container.has(e.target).length === 0 && e.target.nodeName != 'A'){ jQuery(".quick-info").hide(); } });
So with > only single selector chosen.
e.target.nodeName != 'A' is for link , which opens this window. I know, that I could put class or something there.