Add height margin option to handle situations where the expanded div size is just barely larger than maxHeight.