views:

19

answers:

1

I have a div which contains number of elements which user can drag and drop to rearrange inside. Also, he can add new elements from tool bar. I want to increase height of outer div to wrap all those elements. Now they overlap on footer. The challenges I fighting with are - 1. How to find elements which are placed below other. All the elements are have relative positions. 2. Change of height needs to be handled on drop of an element.

I need solution very urgently.

Thanks

A: 

Maybe something like this?

var height = 0;
$("div > *").each(function () {
  height += $(this).height();
})
Codler