Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to write javascript to Display Block

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 12-08-2009
Member
 
Join Date: Nov 2008
Posts: 77
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?

Reply With Quote
  #2  
Old 12-08-2009
Member
 
Join Date: Nov 2008
Posts: 86
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.
Reply With Quote
  #3  
Old 12-08-2009
Member
 
Join Date: Nov 2008
Posts: 102
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.
Reply With Quote
  #4  
Old 12-08-2009
Member
 
Join Date: Oct 2008
Posts: 134
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;
}
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to write javascript to Display Block"
Thread Thread Starter Forum Replies Last Post
How to stop insecure JavaScript block in chrome hanni ball Technology & Internet 3 25-02-2012 11:01 AM
Javascript write to file Din_the1 Software Development 4 29-05-2010 12:38 PM
How do we write exit procedure or function in javascript to exit middle of the program? Jevin Software Development 3 22-09-2009 09:38 AM
How to write javascript isobject Zombi Software Development 3 28-07-2009 11:54 AM
How to write Cookies in Javascript Janet J Windows Software 3 30-01-2009 10:50 PM


All times are GMT +5.5. The time now is 03:18 AM.