jQuery Drag Drop – Resize to Fit Target

This is an example of how to make a draggable object resize to fit the droppable target element.

// (height and width match)	
function dropCallback(event, ui) { 
	var $this = jQuery(this);
	var width = $this.width();
	var height = $this.height();
		height: height,
		width: width,
		top: 0,
		left: 0 

View demo

Leave a Reply