开发者

Can I dynamically adjust the height of a css set div border?

Ok so I have a div that contains a few forms that ha开发者_Go百科ve dynamically generated content. There are categories, that if you click on, slide/toggle down to reveal that categories sub-contents, or projects. Right now, I have it setup so that if the height of the div expands to exceed a set amount, a scroll bar shows up at the side, and the user can scroll down and see the content.

NOW I am being asked to get rid of the scroll bar, and just have the div's border (which is just 1px set in the css) height adjust dynamically with the height of the div's content...can I even do that? Is there some sort of jquery animation that would allow that? A point in the right direction would be greatly appreciated!! Thanks


You now probably have a height set on the container div:

#container {
height: xxpx;
overflow: scroll;
}

Just change that to a min-height:

#container {
min-height: xxpx;
overflow: visible;
}

The div will be at least xx pixels, and grow to fit after that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜