[WEB4LIB] Page length and extra whitespace

Thomas Dowling tdowling at ohiolink.edu
Mon May 16 10:51:55 EDT 2005


Clinton Lowery wrote:
> I have a question --
>  
>  I'm sure there's a way to do this, but I can't think of it.  In
>  using <div> tags and javascript to have layers overlay one another,
>  I'm getting the problem where the page is automatically as long as
>  the longest <div> tag, regardless of which one is currently visible.
>  So what happens is that there is a much longer page than there needs
>  to be.  Is there a javascript that sets the length of the visibile
>  page to the length of the currently opened <div> or is there some
>  other way (using CSS perhaps) to keep the page from becoming much
>  longer than it should be?


It sounds like your script needs to run over all the DIVs that aren't
currently displaying and set each one's visibility property to "hidden"
and set its display property to "none".  For the one DIV that's supposed
to show, set its visibility to "visible" and its display to "block".

IIRC, if you just handle visibility, the space used by the DIV won't
collapse again after it has been displayed.


-- 
Thomas Dowling
tdowling at ohiolink.edu



More information about the Web4lib mailing list