0 Replies Latest reply on Jul 11, 2013 8:43 PM by ExpMoto

    Drag and Drop an Array of items onto a matrix of items

    ExpMoto

      How do I convert this code to drag a single item onto a single target? Using an array approach to keep from copy pasting this code a gazillion times.

       

       

      // insert code to be run when the symbol is created here

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

       

       

       

       

      function init(){

                sym.$('mx1').draggable({opacity:.5, revert:'invalid'});

                sym.$('mx1').sortable({zIndex: 0 });

       

                sym.$('Mx198').droppable({

                  accept:sym.$("mx1"),

                          drop: function() {

                                    sym.getSymbol("mx1").play("Over");

                          }

                          }

                );

       

                sym.$('btn_mx1_home').droppable({

        accept:sym.$("mx1"),

                          drop: function() {

                                    sym.getSymbol("mx1").play("Up");

                          }

                          }

                );

      }

       

       

      Draggables are "Mx1", "Mx2", "Mx3", "Mx4", "Mx5"... "Mx40"

      Targets are "Mx198", "D1", "D2", "D3", "D4"

       

      When the Draggable is drug, it also needs to be above the other items.

       

      Any help would be greatly appreciated!