jquery - Restricting droppable elements on div -
i'm creating , appending droppable div element :
var drop = { drop: function(event, ui) { var add = $("#"+this.id); $('<div id='+counter+' "><div class="mycss">here</div></div>').droppable( drop ).appendto( "#mydivs"); //debugger; counter++; } };
can update div allow divs of id or css allowed dropped ?
yes
.droppable( drop: function(event, ui) { var targetid = $(this).attr("id"); //your conditions check id/class of div . if (targetid == '<your div id restrict>'){ return; } } )
Comments
Post a Comment