Jul 25, 2008

Help Div Layers And Css

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > CSS (Cascading Style Sheets)

free web hosting

Help Div Layers And Css

galexcd
Ok I wasn't sure weather or not to put this in javascript, or CSS, but since it deals more with css, and I'm only using javascript to modify the css, I posted here.

I've got a div layer who's initial CSS attributes are, overflow: hidden; height: 0;

I'm making a javascript function to reveal the contents of this div layer, so I set overflow to visible. Which should change the height of the div layer to match the content of the div layer. Unfortunately, it displays the contents, but what is weird is the height is still 0 blink.gif I seriously have no idea how a div layer with a height of 0 can display anything, but it does... I can set the height via javascript when setting the the overflow, but the problem with that is I have no idea what height to set it to. This div layer will be displaying different amounts of content at different times. I tried every possible css style attribute I know such as pixelHeight, clipBottom, I event tried style.bottom-style.top, but that still gave me 0. Is there anyway of fixing this?

So you don't waist your time suggesting fixes that wont work:
  • Setting the visibility to hidden instead of the overflow and the height will not work because the div layer still is the same size, causing a big empty space
  • Having the content visible at first, then have javascript record the height in a variable, then hide it wont work because I need people without javascript to not see this div layer

 

 

 


Reply

truefusion
A division is nothing like a table as in it does not constrain the data, it allows it to flow beyond the border—this is one reason why i choose tables over divisions on certain designs. Suggestion: Don't change the visibilty, for that'll leave that big empty space you are talking about, but instead change the display.

Reply

galexcd
Ah!! truefusion you're a genius. Thanks so much!! Resolved my problem!

Reply

BuffaloHELP
Truefusion is my boy!! xd.gif This is a good topic and certainly a good tip for all of us. Thank you for the question and the answer.

I'll leave this on for others, just in case.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. layers frontpage different resolutions - 40.42 hr back. (1)
Similar Topics

Keywords : div layers css


    Looking for div, layers, css

Searching Video's for div, layers, css
advertisement



Help Div Layers And Css



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE