Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery UI Draggable revert from outside of window
    primarykey
    data
    text
    <p>Probabely this is a very simple question but i am a beginner in Jquery...</p> <p>I have following Script:</p> <pre><code> &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"&gt;/script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.js"&gt; &lt;/script&gt; &lt;script&gt; $(function() { $('li').draggable({ containment: 'document', revert: true }); $("#config").droppable({ drop: function(event, ui) { $(ui.draggable).appendTo( "#schub" ); } }); }); &lt;/script&gt; </code></pre> <p>And this is what my Body contains:</p> <pre><code> &lt;div style="width:1800px; height:600px; background-color:#efefef;padding:10px;" &gt; &lt;div style="float:left; width:1250px; height:580px; border:1px solid grey; padding:10px;" &gt; &lt;div id="config" style="background-color:blue; border:1px solid black; width:700px; height:500px;"&gt; &lt;ul id="schub" style="width:300px; height:500px;"&gt;&lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div style=" background-color:red;float:left; width:490px; height:580px; border:1px solid grey; margin-left:10px;padding:10px;" id="menu"&gt; &lt;ul class="category"&gt; &lt;li class="dragg" style="background-color:#e6e6e6; border:1px solid black; width:150px; height:98px;"&gt; &lt;/li&gt; &lt;li class="dragg" style="background-color:#e6e6e6; border:1px solid black; width:150px; height:98px;"&gt; &lt;/li&gt; &lt;li class="dragg" style="background-color:#e6e6e6; border:1px solid black; width:150px; height:98px;"&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p></p> <p>Now my issue: I want to be able to drag the grey <code>&lt;li&gt;</code> from the red <code>&lt;div&gt;</code> into the blue <code>&lt;div&gt;</code>. It actually works but the grey <code>&lt;li&gt;</code> are always reverting from outside of the window into the blue <code>&lt;div&gt;</code> when i drop them. Why is that happening?? Isnt it posible that my <code>&lt;li&gt;</code> revert from where i drop them?</p> <p>Thanks very much for your help!</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.
 

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