Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the sound of it, your modal element is inside of the container. I'm guessing you have markup like this.</p> <pre><code>&lt;div id="container"&gt; &lt;span&gt;children&lt;/span&gt; &lt;p&gt;more children&gt; &lt;div id="modal"&gt; Modal text! &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And CSS like this...</p> <pre><code>.noprint { display: none;} .print {display: block;} </code></pre> <p>Which you use JavaScript to apply, like this:</p> <pre><code>&lt;div id="container" class="noprint"&gt; &lt;span&gt;children&lt;/span&gt; &lt;p&gt;more children&gt; &lt;div id="modal" class="print"&gt; Modal text! &lt;/div&gt; &lt;/div&gt; </code></pre> <p>In these examples, the <code>#modal</code> element is inside of a hidden container. The CSS spec dictates that if a parent element is hidden, all children will be hidden also, even if they are set to <code>display: block</code> (or any other valid <code>display</code> value) or are absolutely positioned.</p> <p>What you should do if you want to hide everything on the page except for your modal window is get your markup to be structured something like this:</p> <pre><code>&lt;div id="modal"&gt; Modal Text! &lt;/div&gt; &lt;div id="container"&gt; &lt;span&gt;children&lt;/span&gt; &lt;p&gt;more children&gt; &lt;div id="modal"&gt; Modal text! &lt;/div&gt; &lt;/div&gt; </code></pre> <p>If you have no control over where the modal element is rendered, you can use jQuery to re-position the modal element. Keep in mind that this may impact your modal window's layout:</p> <pre><code>// Moves the element outside of the hidden container $("#container").before($("#modal")); </code></pre>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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