Note that there are some explanatory texts on larger screens.

plurals
  1. POThe jQuery popup does not show at the desired position
    text
    copied!<p>I have a text box and a hidden div which will be shown as a popup. I want when user click on the textbox, the hidden div popup will be displayed at the textbox's position. So, I use the code:</p> <pre><code>var p = $("#listCats"); var position = p.offset(); $('#category').css({"left" : position.left, "top" : position.top}); </code></pre> <p><strong>listCats</strong>: the id of the textbox</p> <p><strong>category</strong>: the id of the hidden div, and it is also the css</p> <pre><code>#category { width: 508px; min-height: 135px; padding: 0.4em; position: absolute; border: 2px solid rgb(124, 113, 113); background: #fff } </code></pre> <p>However, the hidden div popup does not show as I expected, rather:</p> <p><img src="https://i.stack.imgur.com/WQXMD.png" alt="enter image description here"></p> <p>Was I doing something wrong?</p> <p>Edited: The complete hidded div as follows:</p> <pre><code>&lt;div id="category" style="display:none;"&gt; &lt;s:iterator value="categoryMapList"&gt; &lt;div class="cat_label_title parentCat" id="&lt;s:property value="key.id" /&gt;"&gt; &lt;s:property value="key.name" /&gt; &lt;div class="subCat"&gt; &lt;s:iterator value="value" var="category"&gt; &lt;label &gt; &lt;a href="#" class="cat_label_item catItem" name="catItem:&lt;s:property value="key.name" /&gt;, &lt;s:property value="#category.name" /&gt;" id="catItem:&lt;s:property value="#category.id" /&gt;"&gt; &lt;s:property value="#category.name" /&gt; &lt;/a&gt; &lt;/label&gt; &lt;/s:iterator&gt; &lt;/div&gt; &lt;/div&gt; &lt;/s:iterator&gt; &lt;/div&gt; </code></pre>
 

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