1 Reply Latest reply on May 13, 2013 10:13 AM by resdesign

    Drag and drop feedback


      Hi there, forum


      it's been a while since I haven't written at all...


      I'm trying to have a drag and drop game working: the aim is to put every RED fruit into a fruitbasket. I've got the code working for the draggable fruit, but I'm stuck because I don't know how to provide a simple feedback... ie. when all the red fruit are in the fruitbasket the script shows a message like "You did it!"; or a "Try with another fruit" whenever a non red fruit falls into the basket...

      Iv'e been using this kind of code in Tumult Hype, and code was:


      var myNumber = 0;

        $( "#drag_object" ).draggable( "enable" );

                $( "#drag_object" ).draggable({revert: "invalid" });

                $( "#drag_object" ).draggable({snap: "#drop_place", snapTolerance: 8, snapMode: "inner"  });


                $( "#drop_place" ).droppable({accept: "#drag_object", tolerance:"fit"  });


      $( "#drop_place" ).droppable({drop: function() {


          $( "#drag_object" ).draggable( "disable" );












      but I'm not sure if I could adapt it to edge, as I'm not a great coder.


      Project can be found here


      Any ideas? any help?


      Thank you very much!


      El mensaje fue editado por: sito.bernal