[Possible Spam] Re: [Javascript] Removing the Height of a DIV

Paul Novitski paul at novitskisoftware.com
Fri Jul 1 20:20:18 CDT 2005


I'm told that there may be a problem with using display: none; in terms of 
accessibility: some screen-readers might not read a page element whose 
display changes from none to block.

If true, that's really bad news for those of us who depend on display: 
none; but also want to make our pages accessible to everyone.

Can anyone on this list confirm that?

Paul


At 05:39 PM 7/1/2005, Dash wrote:
>as i understand:
>
>If you use style.display = 'block' and style.display = 'none' then you 
>dont have to touch the height and visibility of the div because changing 
>display to none actually makes the html on the page read as though the div 
>doesnt exist - rather than just not allowing you to see it. Therefore when 
>display is 'none' the div doesn't take up any room.
>
>Dash
>
>
>----- Original Message ----- From: "Flavio Gomes" <flavio at economisa.com.br>
>To: "[JavaScript List]" <javascript at LaTech.edu>
>Sent: Friday, July 01, 2005 10:09 PM
>Subject: Re: [Javascript] Removing the Height of a DIV
>
>
>>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
>>
>>
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list