Note that there are some explanatory texts on larger screens.

plurals
  1. PODraggable jQuery UI elements using wrong start position when browser is scrolled?
    primarykey
    data
    text
    <p>I have been using jQuery 1.4.2 and jQuery UI 1.8.5 to create draggable elements that revert back to their original position. There is a problem though; when you've scrolled the browser window the start position will be changed to start somewhere higher. It looks like an absolute position is used but the amount that has been scrolled is not taken into consideration, but I cannot be sure. I have done all my development and testing in FireFox.</p> <p>Here is a short video that I have recorded about this.. <a href="http://www.youtube.com/watch?v=KPW4ljpjuF8" rel="noreferrer">http://www.youtube.com/watch?v=KPW4ljpjuF8</a></p> <p>The JavaScript initialization code looks like this..</p> <pre><code> $( '.frameworkNavigationItem' ).draggable({ appendTo : 'body', revert : 'invalid', containment : 'body', zIndex : 999 }); </code></pre> <p>The HTML of one of the elements looks like this..</p> <pre><code>&lt;div class="frameworkNavigationItem frameworkNavigationItemColor"&gt; &lt;div class="frameworkNavigationItemName"&gt;Home&lt;/div&gt; &lt;div class="frameworkNavigationItemDisplay"&gt; &lt;input type="checkbox" checked="true" name="2_1"&gt; &lt;input type="checkbox" checked="true" name="2_2"&gt; &lt;input type="checkbox" checked="true" name="2_4"&gt; &lt;/div&gt; &lt;div class="frameworkNavigationItemController"&gt; &lt;input type="text" maxlength="255" value="mainNews" name="2_co"&gt; &lt;/div&gt; &lt;div class="frameworkNavigationItemChild"&gt; &lt;select name="2_ch"&gt; &lt;option value="0"&gt;-&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div style="clear: both;"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>And this is the CSS to go along with it.</p> <pre><code> .frameworkNavigationItem { background-color : #CACACA; height : 20px; line-height : 20px; margin : 2px 0; vertical-align : middle; } .frameworkNavigationItem:hover { background-color : #BABABA; } .frameworkNavigationItem:hover input, .frameworkNavigationItem:hover select { background-color : #BABABA; } .frameworkNavigationItem input, .frameworkNavigationItem select { background-color : #CACACA; border : 0; font-size : 10px; } .frameworkNavigationItemColor { background-color : #DADADA; } .frameworkNavigationItemColor input, .frameworkNavigationItemColor select { background-color : #DADADA; } .frameworkNavigationItemName { float : left; height : 15px; padding-left : 5px; } .frameworkNavigationItemDisplay { float : right; text-align : right; width : 48px; } .frameworkNavigationItemController { float : right; width : 160px; } .frameworkNavigationItemController input { width : 150px; } .frameworkNavigationItemChild { float : right; width : 160px; } .frameworkNavigationItemChild select { width : 150px; } </code></pre> <p>Please help me out! I don't know why this is happening.</p>
    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.
 

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