Note that there are some explanatory texts on larger screens.

plurals
  1. POError with draggable and droppable image
    primarykey
    data
    text
    <p>I am trying to make 2 images draggable on 3 droppable images. when i drag first image over drop1, it prints Drop11, similarly on drag2 and drag3 it prints Drop12 and Drop13. When i drag second image it must print Drag21, Drag22 and Drag23 resp.</p> <p>all works fine, but when i drag first image over any of dropable it prints what it should. But after that, if i drag second drag image to any of dropable, it first prints msg of first droppale, and when i drop it there again, then it prints the second droppable's msg (means first it prints 13 first, and 23 if dragged again). It folllws this so on.</p> <p>what is wrong in my code..? my code is</p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;jQuery UI Droppable - Default functionality&lt;/title&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="/resources/demos/style.css"&gt; &lt;style&gt; #draggable1 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; } #draggable2 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; } #droppable1 { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; } #droppable2 { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; } #droppable3 { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; } &lt;/style&gt; &lt;script&gt; $(document).ready(function() { $("#draggable1").click(function(){ $( "#draggable1" ).draggable(); $( "#droppable1" ).droppable({ drop: function( event, ui ) { $( this ) .addClass( "ui-state-highlight" ) .find( "p" ) .html( "Dropped 11!" ); } }); }); }); $(document).ready(function() { $("#draggable1").click(function(){ $( "#draggable1" ).draggable(); $( "#droppable2" ).droppable({ drop: function( event, ui ) { $( this ) .addClass( "ui-state-highlight" ) .find( "p" ) .html( "Dropped 12!" ); } }); }); }); $(document).ready(function() { $("#draggable1").click(function(){ $( "#draggable1" ).draggable(); $( "#droppable3" ).droppable({ drop: function( event, ui ) { $( this ) .addClass( "ui-state-highlight" ) .find( "p" ) .html( "Dropped 13!" ); } }); }); }); $(document).ready(function() { $("#draggable2").click(function(){ $( "#draggable2" ).draggable(); $( "#droppable1" ).droppable({ drop: function( event, ui ) { $( this ) .addClass( "ui-state-highlight" ) .find( "p" ) .html( "Dropped 21!" ); } }); }); }); $(document).ready(function() { $("#draggable2").click(function(){ $( "#draggable2" ).draggable(); $( "#droppable2" ).droppable({ drop: function( event, ui ) { $( this ) .addClass( "ui-state-highlight" ) .find( "p" ) .html( "Dropped 22!" ); } }); }); }); $(document).ready(function() { $("#draggable2").click(function(){ $( "#draggable2" ).draggable(); $( "#droppable3" ).droppable({ drop: function( event, ui ) { $( this ) .addClass( "ui-state-highlight" ) .find( "p" ) .html( "Dropped 23!" ); } }); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="draggable1" class="ui-widget-content"&gt; &lt;p&gt;Drag 1&lt;/p&gt; &lt;/div&gt; &lt;div id="draggable2" class="ui-widget-content"&gt; &lt;p&gt;Drag 2&lt;/p&gt; &lt;/div&gt; &lt;div id="droppable1" class="ui-widget-header"&gt; &lt;p&gt;Drop 1&lt;/p&gt; &lt;/div&gt; &lt;div id="droppable2" class="ui-widget-header"&gt; &lt;p&gt;Drop 2&lt;/p&gt; &lt;/div&gt; &lt;div id="droppable3" class="ui-widget-header"&gt; &lt;p&gt;Drop 3&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>screenshots - </p> <p><img src="https://i.stack.imgur.com/LHf9B.jpg" alt="First Screen"></p> <p><img src="https://i.stack.imgur.com/RYROR.jpg" alt="Second Screen"></p>
    singulars
    1. This table or related slice is empty.
    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. 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