Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] dynamically hide an element
- From: nick at nickfitz.co.uk (Nick Fitzsimons)
- Subject: [Javascript] dynamically hide an element
- Date: Wed Nov 29 06:54:13 2006
On 29 Nov 2006, at 13:25:28, Fl?vio Gomes wrote: > What I'm going to talk is css related, but I believe it fits in > the topic: > > If you set display to none the element disappears, period. > > But when you want it to be shown again you have to take care on > which of the options to take, inline or block. > > If you set it to "block" it'll create a line break after and > before the selected element. For a DIV that wouldn't be a great > problem, but for an image or a form element It'd be. > The thing to do if you might be setting the value of "display" on either block or inline elements is to set it to the empty string "". That way, it will just revert to its default value, or any value specified in a stylesheet that overrides the default. But generally, the class-setting technique described earlier in this thread by Mark Kelly is the best way to go, if possible. Regards, Nick. -- Nick Fitzsimons http://www.nickfitz.co.uk/
- Follow-Ups:
- [Javascript] error in "JavaScript: The Definitive Guide"?
- From: John Deighan
- [Javascript] error in "JavaScript: The Definitive Guide"?
- References:
- [Javascript] dynamically hide an element
- From: Dong, Roland
- [Javascript] dynamically hide an element
- From: Mark Kelly
- [Javascript] dynamically hide an element
- From: Flávio Gomes
- [Javascript] dynamically hide an element
- Prev by Date: [Javascript] pb with httprequest and firefox
- Next by Date: [Javascript] error in "JavaScript: The Definitive Guide"?
- Previous by thread: [Javascript] dynamically hide an element
- Next by thread: [Javascript] error in "JavaScript: The Definitive Guide"?
- Index(es):