I am trying to drag and drop image and make the cloned droppable image resizable after drop without any luck...
My code is:
<img class="dragger" id="obj1" style="cursor: -webkit-grab;float:left; margin-left:5px; margin-top:5px;" src="objects/bike.png" width="80" height="80">
<img class="dragger" id="obj2" style="cursor: -webkit-grab;float:left; margin-left:5px; margin-top:5px;" src="objects/car.png" width="80" height="80">
//The dropable div
<div id="contentHolder"></div>
Jquery Code:
<script>
$(document).ready(function() {
window.zindex = 999;
//$(".dragger").resizable({handles: 'ne, se, sw, nw'});
$(".dragger").draggable({
helper: "clone"
}).on('dragstop', function (event, ui) {
$(this).after($(ui.helper).clone().draggable());
});
$("#contentHolder").droppable({
drop: function(event, ui) {
var id = ui.draggable;
if(ui.draggable.hasClass("dragger")) {
$(".dragger").each(function(i) {
$(this).attr('id', "dragger" + (i + 1));
$(this).removeClass( "dragger" ).addClass("dragger" + (i + 1));
$("dragger" + (i + 1)).resizable({handles: 'ne, se, sw, nw'});
});
}
}
});
});
Any suggestions why my cloned droppable images isn't resizable?