• 2k
  • 98
  • 24.7k

Trash is not working properly

May 11 2013 3:27 AM


 Trash is not working properly for me...Can anyone please tell me?

here is my code...

<script type="text/javascript">

      $(document).ready(function() {


          counter = 0;

          //Make element draggable


              helper: 'clone',

              containment: 'frame',

              //When first dragged

              stop: function(ev, ui) {

                  var pos = $(ui.helper).offset();

                  objName = "#clonediv" + counter

                  $(objName).css({ "left": pos.left, "top": });


                  //When an existiung object is dragged


                      containment: 'parent',

                      stop: function(ev, ui) {

                          var pos = $(ui.helper).offset();








          //Make element droppable


              drop: function(ev, ui) {

                  if (ui.helper.attr('id').search(/drag[0-9]/) != -1) {


                      var element = $(ui.draggable).clone();



                      $(".tempclass").attr("id", "clonediv" + counter);

                      $("#clonediv" + counter).removeClass("tempclass");

                      //Get the dynamically item id

                      draggedNumber = ui.helper.attr('id').search(/drag([0-9])/)

                      itemDragged = "dragged" + RegExp.$1


                      $("#clonediv" + counter).addClass(itemDragged);

                      drop:function(ev, ui) {
                                          accept: "#frame",







After dragging the letters into particular cell from that into trash it's working fine,problem is the letters are in the left side of the puzzle also droppable into trash permanantly.I want only drop the letters from cells into trash.