javascript - Jquery Droppable not working for Dynamically added DIVS -
I have the same problem and
I need to resize drag drop and function functionality, It works well with a static element, but I have to add dynamic devices, and this resize property works properly for dynamic devices, but droppable < / Strong> Functionality Not working ... I spent the last day in R & D and found solutions for that
This is one
How can I remove it?
Here is the code snippet
< Strong> CSS
# section1> Div {Display: Table-Cell; / * Width: 1%; * / Border-right: 1px dotted red; Text align: center; }
HTML
& lt; Input type = "button" class = "mybutton" value = "add div" /> & Lt; Br / & gt; & Lt; Div class = "selectorfild" style = "height: 100px; width: 100px; background-color: green;" & Gt; & Lt; / Div & gt; & Lt; Div id = "section1" style = "height: 100px; line-height: 20px; width: 100%; limit: 1px dotted red; display: table;" & Gt; & Lt; Div class = "well-dropped field Yuri-sortable Resizable" style = "width: 73px;" & Gt; & Lt; / Div & gt; & Lt; / Div & gt;
JQUERY
function macregume () {$ ("selectorField"). Drug ($ prevention: $ ('body'), helper: "clone", heap: "div", cursor: "move", cancel: null});} $ (function () {var _ctrl_index = 1001 Resizeable ({handle: 'e'}); MacDragable (); $ ("dropped field"). Droppable ({accept: ": no (.ui-sortable-helper) ", Drop: function (event, ui) {var draggable = ui.draggable; draggable = draggable.clone (); dragable. AppendTo (this); makeDraggable ();}}); // add divs dyynamically var count = ($ '' Mybutton '). (Function () {count ++; if (calculation & lt; 5) {// alert ("AA"); var a = $ ("& lt; div Class = 'well The given terms are ui-sortable Resizable '& gt; & lt; / div & gt; "). AppendTo (" # section1 "); a.droppable (); a.resizable ({handle:' e '}); } Else {Warning (no more divs to add '}}}};});
Everyone needs your kind help < / P>
You are not creating dynamic div droppable
to display this change I've updated your Line 52 See.
Comments
Post a Comment