[Javascript] Removing the Height of a DIV
Flavio Gomes
flavio at economisa.com.br
Fri Jul 1 16:09:59 CDT 2005
Try this:
(...)
if (bShow) // Show division
{
// document.getElementById(sLayername).style.visibility = 'visible';
// document.getElementById(sLayername).style.height = 'auto';
document.getElementById(sLayername).style.display = 'block';
}
else // Hide division
{
// document.getElementById(sLayername).style.visibility = 'hidden';
// document.getElementById(sLayername).style.height = '0';
document.getElementById(sLayername).style.display = 'none';
}
(...)
Ps.: I was missing the questions that me and my skills were able to
reply... T_T
--
Flavio Gomes
flavio at economisa.com.br
Glenn E. Lanier, II wrote:
> I want to show/hide a div based on a radio button selection. I have
> everything working somewhat, but I'd like to give the div a height of
> 0 when it is hidden so I don't have a large "gap" of content.
>
> JavaScript:
>
> function ShowLayer(sLayername, bShow)
> {
> if (bShow) // Show division
> {
> document.getElementById(sLayername).style.visibility = 'visible';
> document.getElementById(sLayername).style.height = 'auto';
> }
> else // Hide division
> {
> document.getElementById(sLayername).style.visibility = 'hidden';
> document.getElementById(sLayername).style.height = '0';
> }
> }
> ShowLayer('divPaymentOptions', false);
>
> HTML:
>
> <div id="divPaymentOptions">Varying content, multiple lines</div>
>
> Any thoughts?
>
> Thanks.
>
> --G
>
> ------------------------------------------------------------------------
> *Glenn E. Lanier II*
> **/ /*Email: glenn_lanier at netzero.net <mailto:glenn_lanier at netzero.net>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
More information about the Javascript
mailing list