How to write javascript to Display Block
I usually stay away from dynamically hiding and showing layers, When the user clicks on the div containing the word "Menu", the lower div (id = dropper) displays as a block (which is fine). I am trying to make a link or div that you can click and have another div appear under it. Ideally i want it to use the css display. However, when the user clicks on the "Menu" div again, the dropper div does not revert back to display:none. Any thoughts?
Re: How to write javascript to Display Block
In each of your "onclick" events that call that function, all you need to do is include the id of the div you want to show when you call the function. 'display' property of CSS decides how an element would be displayed. Since you already have a table, it doesn't make sense to set the display property to table. IE doesn't use or respect the proper CSS display values for tables, rows etc. You simply use "block". Very convenient, but it doesn't work well in well-behaved browsers.
Re: How to write javascript to Display Block
The javascript dom model for setting css properties is quite outdated (just like functions Dreamweaver injects in your code for swapping images). I have tried out the setting of display property but it has blocked me. Mysteriously enough, it didn't work neither in IE nor in any other browser! therefor i use the visibility property. There are three selections: visible, hidden, and collapse. Visibility is also a recognized style method. You may try this for your problem.
Re: How to write javascript to Display Block
When the script replaces the IMG with the SPAN it transfers the width and height properties of the IMG to the CSS width and height properties of the SPAN's style attribute. You need to take the block out of #logo the image image blg_title_images shows up but blg_logo has a 3px space under it. If I leave block in the space goes away and so does blg_title_images. Try out the following display block in your program.
Code:
p.inline
{
display:inline;
}