View Single Post
Old 08-28-2012, 09:15 PM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
I would like to point out that if you are really toggling <span> elements (you call your function togglespan) then toggling between "none" and "block" may be the wrong thing, entirely.

<span>s are *inline* elements, meaning (for example) that you can do stuff like this:
Code:
This is an <span style="color: red;">example</span> of an inline element.
and it will appear in the browser all on the same line.

If you change span to display: block; then that line would end up broken:
Code:
This is an 
<span style="display: block; color: red;">example</span> 
of an inline element.
That is, on multiple lines in the browser.

Normally, with <span>, you would want to toggle between "none" and "inline" (instead of "block").
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote