View Full Version : setting DHTML list height

12-20-2005, 12:25 AM
I'm using ul to render a scrollable list (rather than using select) and I'd like to be able to set the list height to to be able to view N items. I've tried using style="height:Nem" which seems to be off by one (close enough), but it doesn't account for things like border/padding/margin height. Is there a way to account for all this up front without the list flickering because it was rendered with one height and I have to run javascript to reset the height to something else???

P.S. I'm not using a select because it renders ontop of DIVs (yes, I know about wrapping the DIV with an IFRAME) and the border style cannot be set.

12-20-2005, 12:42 AM
I guess you could do it dynamically


12-20-2005, 12:59 AM
I know, I am worried about the list flickering in size as it is rendered, then the height is reset. The style info is not available until after the page is rendered.
I'll have to just do it and see how bad things are on the different browsers.