Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery UI dialog box manual close
    primarykey
    data
    text
    <p>I am using jQuery UI Dialog Box.</p> <p>When I am clicking on a button the dialog box should open. When the dialog box is opened then whole body should be in a disable state. Like how exactly when we are using a popup. So for that I have used the below code.</p> <p>Here is <a href="http://jsfiddle.net/nRQXA/" rel="nofollow">Js Fiddle</a> Link</p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="/resources/demos/style.css" /&gt; &lt;script&gt; $(document).ready(function(e) { $("#popup").click(function(){ $( "#dialog" ).dialog(); $( ".parentDisable" ).show(); }); $(".parentDisable").click(function(){ $( "#dialog" ).dialog('close'); $( ".parentDisable" ).fadeOut(1000); }); $(".ui-button-icon-primary").click(function(){ $( "#dialog" ).dialog('close'); $( ".parentDisable" ).fadeOut(1000); }); }); &lt;/script&gt; &lt;style&gt; .parentDisable{ position:fixed; top:0; left:0; background:#000; opacity:0.8; z-index:1; height:100%; width:100%;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="dialog" title="Basic dialog" style="display:none;"&gt; &lt;p&gt;This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.&lt;/p&gt; &lt;/div&gt; &lt;div class="parentDisable" style="display:none;"&gt;&lt;/div&gt; &lt;span id="popup" style="color:blue;cursor:pointer"&gt;Pop Up&lt;/span&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Here I have problem. When I am clicking on button pop up is opening and the whole body is covered with Black background.</p> <p>Now the user should able to close in two types.</p> <ol> <li>By clicking on close symbol in the popup. </li> <li>By clicking on out side area of popup (On Black Background) </li> </ol> <p>The 2nd way mentioned above is working fine. But in the first method when I am clicking on close symbol only the POPUP is getting close and the black background is remains same.</p> <p>I have tried in some ways. But it has not worked.<br> Please give any suggestions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload