Quantcast
Viewing all articles
Browse latest Browse all 9897

Drag and Drop a Matrix of items onto a matrix of items

How do I convert this code to drag a single item onto a single target? Using a matrix 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! Image may be NSFW.
Clik here to view.


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>