Note that there are some explanatory texts on larger screens.

plurals
  1. POPositioning the element second time using JQuery UI's position does not work as expcted
    primarykey
    data
    text
    <p>Here is my fiddle: <a href="http://jsfiddle.net/Ya3w7/2/" rel="nofollow">http://jsfiddle.net/Ya3w7/2/</a></p> <p>HTML: </p> <pre><code>&lt;img src="http://cdn.tacky.me/m/static/settings16.png" class="settings-icon"/&gt; &lt;div id="control-panel"&gt; &lt;img src="http://cdn.tacky.me/m/static/settings16.png" /&gt; &lt;a href="#" style="float:right" id="close-cp"&gt;X&lt;/a&gt; &lt;div class="link_container"&gt;&lt;a href="#"&gt;Show Profile&lt;/a&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS:</p> <pre><code>.settings-icon { margin: 100px; cursor: pointer; } #control-panel { position: absolute; height: auto; width: auto; top: 0; left: 0; background-color: #fff; font-family: Arial, sans-serif; display: none; z-index: 4; } </code></pre> <p>JavaScript:</p> <pre><code>$('.settings-icon').click(function(){ $('#control-panel').position({ of: $('.settings-icon'), my: 'left top', at: 'left top' }); $('#control-panel').show(); }); $('#close-cp').click(function(event){ event.preventDefault(); $('#control-panel').hide(); }); </code></pre> <p><strong>What I am trying to do:</strong> I have a settings image, upon clicking which it positions an absolutely positioned div (called contgrol-panel) around this img.</p> <p><strong>What I am seeing:</strong></p> <p>First time I click on the img it works fine</p> <p>I dismiss the control panel by clicking on X on the top right corner</p> <p>Second time I click the control panel shows up somewhere else</p> <p><strong>How to Repro</strong></p> <p>Go to the fiddle</p> <ul> <li>Click on the settings icon for the first time</li> <li>Dismiss the control panel which drops down by clicking on the X</li> <li>Click on the settings icon once again</li> <li>See control panel popping up somewhere else</li> </ul>
    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