I found this code in one of the other questions on here. It's exactly what i'm looking for (draggable and it neatly stacks the divs based on which one was clicked last) except I also want the div ids to be resizable but I can't figure out how to do it without messing the code up.
$(document).ready(function() {
var a = 3;
$('#box1,#box2,#box3,#box4').draggable({
start: function(event, ui) { $(this).css("z-index", a++); }
});
$('#dragZone div').click(function() {
$(this).addClass('top').removeClass('bottom');
$(this).siblings().removeClass('top').addClass('bottom');
$(this).css("z-index", a++);
});
});