2 Replies Latest reply on Aug 28, 2015 10:32 PM by chloeb63438168

    Need help with Edge Animate: Drag and Drop

    chloeb63438168

      Im having trouble making symbols which are not accepted by the basket symbol, return to their original position once they have been rejected

       

      //load jquery

      yepnope({nope:['jquery-ui-1.10.3.custom.min.js'], complete:init});

       

       

      //set counter

      sym.setParameter("counter", 0);

       

       

      //create variable to count the number of "right" drops

      var semafor = sym.composition.getStage().getParameter("counter");

       

       

      //define function init()

      function init(){

       

       

       

       

      //define draggable items and set scope to items that get accepted by droppable

      sym.$("Banana").draggable({scope:"gear"});

      sym.$("Banana1").draggable({scope:"gear"});

      sym.$("Orange").draggable();

      sym.$("Apple").draggable();

       

       

       

       

       

       

      //define droppable and the scope it accepts

      sym.$("basket").droppable(

      {scope:"gear"},

       

       

      //define what happens when an item is dropped

      {drop: function() {

      semafor = semafor + 1;

      sym.getComposition().getStage().$("brpredmeta_txt").html(semafor);}

      }

       

       

      )

      }

      //load jquery

      yepnope({nope:['jquery-ui-1.10.3.custom.min.js'], complete:init});

       

       

      //set counter

      sym.setParameter("counter", 0);

       

       

      //create variable to count the number of "right" drops

      var semafor = sym.composition.getStage().getParameter("counter");

       

       

      //define function init()

      function init(){

       

       

       

       

      //define draggable items and set scope to items that get accepted by droppable

      sym.$("Banana").draggable({scope:"gear"});

      sym.$("Banana1").draggable({scope:"gear"});

      sym.$("Orange").draggable();

      sym.$("Apple").draggable();

       

       

       

      //define droppable and the scope it accepts

      sym.$("basket").droppable(

      {scope:"gear"},

       

       

      //define what happens when an item is dropped

      {drop: function() {

      semafor = semafor + 1;

      sym.getComposition().getStage().$("brpredmeta_txt").html(semafor);}

      }

       

       

      )

      }