http://jsfiddle.net/mnbayazit/by3zy/2/
I want the popup to disappear when I click somewhere in the background. The problem is that it disappears when I click the [X] button or popup.
Imagine being a calendar picker if that makes my intentions clearer.
How can I get this done?
Install a handler clickso that the body removes your popup.
click
Set a handler clickfor the popup itself that triggers stopPropagation()in the event to prevent it from popping into the body.
stopPropagation()
Rough:
function showMyPopup(){ ... $(myPopupDiv).click(function(e){ e.stopPropagation(); }); } function closeMyPopup(){ ... } $(document.body).click(closeMyPopup);
jist , ( , z-index), "" click . , , , 100% ( ).
z-index
Source: https://habr.com/ru/post/1793756/More articles:A set of eyecon color panels appears behind the jqgrid (jqueryui) dialog in the edit form - jqueryShowing mySQL images by category and / or tag - phpMonoTouch Image Gallery Business Card - c #getting around this with jquery gives me undefined - javascriptUse images created from canvas - javascriptWhat is the correct method for encrypting ASP.NET communications? - c #C ++ Noobie - I can't solve this for my homework. I am stuck. Please help! - c ++Connector Encryption in an Application MVC2.NET 4.0 - asp.netWCF reliable messages: stuttering after maxPendingChannels increase - .net-4.0Why does C strcpy fail with double-indexed arrays? - cAll Articles