This is an example of how to make a draggable object resize to fit the droppable target element.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | jQuery(".target").droppable(); // (height and width match) function dropCallback(event, ui) { var $this = jQuery(this); $this.append(ui.draggable); var width = $this.width(); var height = $this.height(); ui.draggable.css({ height: height, width: width, top: 0, left: 0 }); } |