Drag n Drop: How to detect element which into dropped - jquery, threedupmedia -
I'm using the jquery Drag'n'Drop plugin from threedupmedia, I already drag-n-drop in a drop zone I've managed now I now have a lot of drop zones and I have to find out how the element was removed in the drop zone. But I do not know anything about how to do it.
You can see the usage case and simplified mark-up
jQuery (function ($) $ $ ('.dnd-btn') .drag ("Start Drag ("end", function (ev, dd) {if (! $ (This) .hasClass ('dropped')) {$ (this). CSS ({top : Dd.originalY, left: dd.originalX}; else {$ (this) .removeClass ('dropped');}}) .drag (function (ev, dd) {$ (this) .css ({top: dd.offsetY, left: dd.offsetX}}}, {relative: true, drop: '.dnd-drop'}) $ ('.dnd-drop (function (avi, dd) {console.log (ev) ); // Show it again on the faded element and the original position: $ (dd.drag) .addClass ('dropped'). FadeOut ('slow', function () {$ (dd.drag). CSS ({ top: dd .originalY, left: dd.originalX}). $ ('. Balance'). Parent (). RemoveClass ('data (' price ')) static (2); console.log (value); Balance = $ ('.balance'); var accountVal = parseFloat (balance.text); accountwell = accountwall - price; b alance.text (accountVal.toFixed (2));});});
Well I tried it a good obsession and understood it using the error algorithm. It's as easy as baking cake: simply use $ (dd.drop) in the drop down event to get the current element that was dropped.
$ ('.dnd-drop'). Drop (function (ev, dd) {$ (dd.drop) .text ("I am searching for you!");});
Comments
Post a Comment