Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Hiding/Showing Elements with javascript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jonathan Wood - 18 Mar 2008 06:02 GMT
I'm having some more problems with javascript.

I needed some script to hide and show elements of my page in response to
certain actions. So my script uses document.getElementById and sets
style.display='none' to hide the element, and sets style.display='block' to
display it.

This seemed to be working fine in IE7 but I found out it looked totally
wrong in FireFox and Opera. (Sorry that I don't have a link.)

It turns out that this is caused by setting display to block that is messing
up the formatting on objects like table rows (tr).

Is anyone familiar with this behavior? I seem to have resolved this issue by
showing items with style.display='' but I'm not sure if this is
non-standard, or perfectly standard.

Any comments would be welcome on the best way to hide and show elements
without altering their appearance.

Thanks.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Mark Rae [MVP] - 18 Mar 2008 09:26 GMT
> Any comments would be welcome on the best way to hide and show elements
> without altering their appearance.

http://www.devx.com/tips/Tip/13638

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.