HighDots Forums  

DHTML problem with 2-col + footer CSS Layout

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss DHTML problem with 2-col + footer CSS Layout in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Xavier Onassis
 
Posts: n/a

Default DHTML problem with 2-col + footer CSS Layout - 03-14-2005 , 10:51 AM






I would be grateful for recommendations for a CSS layout (header, 2 cols,
footer) that can accomodate dynamically added elements. I am not having any
luck so far getting this to work in Mozilla/Firefox. Success so far only
with IE. In Mozilla/Firefox, the layout does not adjust when nodes are
inserted into the document dynamically.

Layout:

H E A D E R
COL1 COL2
F O O T E R

Content on the page can change in two ways:

1. User clicks on a link in COL1, which makes a corresponding DIV in COL2
visible and the others there invisible.
The DIVS in COL2 are not all the same length. Sometimes the visible DIV will
have 10 lines, say, and at others, 20.
Mozilla/Firefox handles this OK.

2. COL2 also contains an expanding menu. When the user clicks on a menu-item
in COL2, dynamic HTML content is fetced from the database and injected into
COL2 below the clicked-on link: an element containing nodes is added to the
DIV using .insertBefore method. The dynamic insertion of the element causes
the length of COL2 to change dramatically.
Mozilla/Firefox does not handle this. When HTML is added dynamically to
COL2, the FOOTER DIV (in Firefox) stays just where it was, and the
dynamically injected content overwrites the footer and extends down below
it. The footer is acting as though it were absolutely positioned. The FOOTER
DIV's vertical position should adjust according to the new length of COL2.

Thanks in advance
Xav






Reply With Quote
  #2  
Old   
Els
 
Posts: n/a

Default Re: DHTML problem with 2-col + footer CSS Layout - 03-14-2005 , 11:03 AM






Xavier Onassis wrote:

Quote:
I would be grateful for recommendations for a CSS layout
(header, 2 cols, footer) that can accomodate dynamically
added elements. I am not having any luck so far getting
this to work in Mozilla/Firefox. Success so far only with
IE. In Mozilla/Firefox, the layout does not adjust when
nodes are inserted into the document dynamically.

Layout:

H E A D E R
COL1 COL2
F O O T E R
[snip long story without relevant information]

A url would actually show the problem, while this story
doesn't tell us anything. It doesn't even say what your HTML
looks like, or if you used CSS to position any part of that
page.
The only thing I can deduct is that you didn't give the footer
position:absolute.

However, your problem seems pretty common, and the answer will
most likely contain the words "add an element with
'clear:both'".
Depending on your code and the look of your page, this could
possibly be followed by the words "before the end of COL2" or
"right before the footer". Or these two groups of words could
be replaced by "add clear:both to the styles for the footer".

And still, this might not be the right answer at all.
Or it may seem like the right answer when you check one of
these options in Firefox, until you have a look in an older
Mozilla or Netscape browser. No way to tell without a url.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Nazareth - This Flight Tonight


Reply With Quote
  #3  
Old   
Xavier Onassis
 
Posts: n/a

Default Re: DHTML problem with 2-col + footer CSS Layout - 03-15-2005 , 08:13 AM



Sorry, I cannot provide a URL at this point. The problem is on an internal
page of our company webserver and involves a database. I understand that
lack of a URL makes it very difficult to help and am grateful that you took
a crack at solving the problem anyway. For anyone else who may have seen
this problem, I will try to make a long story short.

My column2 contains a treeview. When the page first displays, everything is
OK. Header, Col1, Col2, and Footer are all in the right place. When a
treenode is clicked for the first time, its children nodes are fetched from
a database and corresponding HTML elements (DIVs) are inserted into the
document as children of the clicked node (also a DIV):

<DIV class='treenode'></DIV>
<DIV class = 'treenode'> <!--this node has been expanded by the user and so
contains child elements-->
<DIV class='fetchedtreenode'> </DIV>
<DIV class='fetchedtreenode'> </DIV>
<DIV class='fetchedtreenode'> </DIV>
ET CETERA...
</DIV>

Thus, col2's contents "grow" dynamically at runtime. This is where the
problem enters. In Mozilla/Firefox, the fetched nodes display where they
should, but the footer is behaving as though it has been given a
POSITION:ABSOLUTE style, but it hasn't:

#ftr {clear: both; height : 25px;
position: relative;
background : #c0c0c0;
color : #333333;
border : medium solid black;
border-width : 1px 0 0;
margin : 0;}

The footer is staying put even as col2 expands, and the effect is that some
of the fetchedtreenodes display below the footer.
Regards
Xavier

"Els" <els.aNOSPAM (AT) tiscali (DOT) nl> wrote

Quote:
Xavier Onassis wrote:

I would be grateful for recommendations for a CSS layout
(header, 2 cols, footer) that can accomodate dynamically
added elements. I am not having any luck so far getting
this to work in Mozilla/Firefox. Success so far only with
IE. In Mozilla/Firefox, the layout does not adjust when
nodes are inserted into the document dynamically.

Layout:

H E A D E R
COL1 COL2
F O O T E R

[snip long story without relevant information]

A url would actually show the problem, while this story
doesn't tell us anything. It doesn't even say what your HTML
looks like, or if you used CSS to position any part of that
page.
The only thing I can deduct is that you didn't give the footer
position:absolute.

However, your problem seems pretty common, and the answer will
most likely contain the words "add an element with
'clear:both'".
Depending on your code and the look of your page, this could
possibly be followed by the words "before the end of COL2" or
"right before the footer". Or these two groups of words could
be replaced by "add clear:both to the styles for the footer".

And still, this might not be the right answer at all.
Or it may seem like the right answer when you check one of
these options in Firefox, until you have a look in an older
Mozilla or Netscape browser. No way to tell without a url.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Nazareth - This Flight Tonight



Reply With Quote
  #4  
Old   
Martin!
 
Posts: n/a

Default Re: DHTML problem with 2-col + footer CSS Layout - 03-15-2005 , 08:25 AM



(topposting sucks but inconsistancy sucks even harder)

it is indeed difficult to make a complete picture of your problem this
way. it would indeed be a lot better if you would at least show a layout
example or 2 (with/without problem) (even preferable when you leave the
company content out).

but question : why do you have position: relative; in your #ftr ?
and, did you have a look at
http://www.alistapart.com/articles/footers/ ?
(although i dont find this footer example very practical)

gl
martin




Xavier Onassis wrote:

Quote:
Sorry, I cannot provide a URL at this point. The problem is on an internal
page of our company webserver and involves a database. I understand that
lack of a URL makes it very difficult to help and am grateful that you took
a crack at solving the problem anyway. For anyone else who may have seen
this problem, I will try to make a long story short.

My column2 contains a treeview. When the page first displays, everything is
OK. Header, Col1, Col2, and Footer are all in the right place. When a
treenode is clicked for the first time, its children nodes are fetched from
a database and corresponding HTML elements (DIVs) are inserted into the
document as children of the clicked node (also a DIV):

DIV class='treenode'></DIV
DIV class = 'treenode'> <!--this node has been expanded by the user and so
contains child elements--
DIV class='fetchedtreenode'> </DIV
DIV class='fetchedtreenode'> </DIV
DIV class='fetchedtreenode'> </DIV
ET CETERA...
/DIV

Thus, col2's contents "grow" dynamically at runtime. This is where the
problem enters. In Mozilla/Firefox, the fetched nodes display where they
should, but the footer is behaving as though it has been given a
POSITION:ABSOLUTE style, but it hasn't:

#ftr {clear: both; height : 25px;
position: relative;
background : #c0c0c0;
color : #333333;
border : medium solid black;
border-width : 1px 0 0;
margin : 0;}

The footer is staying put even as col2 expands, and the effect is that some
of the fetchedtreenodes display below the footer.
Regards
Xavier

"Els" <els.aNOSPAM (AT) tiscali (DOT) nl> wrote in message
news:Xns9619AD855323FEls (AT) 130 (DOT) 133.1.4...

Xavier Onassis wrote:


I would be grateful for recommendations for a CSS layout
(header, 2 cols, footer) that can accomodate dynamically
added elements. I am not having any luck so far getting
this to work in Mozilla/Firefox. Success so far only with
IE. In Mozilla/Firefox, the layout does not adjust when
nodes are inserted into the document dynamically.

Layout:

H E A D E R
COL1 COL2
F O O T E R

[snip long story without relevant information]

A url would actually show the problem, while this story
doesn't tell us anything. It doesn't even say what your HTML
looks like, or if you used CSS to position any part of that
page.
The only thing I can deduct is that you didn't give the footer
position:absolute.

However, your problem seems pretty common, and the answer will
most likely contain the words "add an element with
'clear:both'".
Depending on your code and the look of your page, this could
possibly be followed by the words "before the end of COL2" or
"right before the footer". Or these two groups of words could
be replaced by "add clear:both to the styles for the footer".

And still, this might not be the right answer at all.
Or it may seem like the right answer when you check one of
these options in Firefox, until you have a look in an older
Mozilla or Netscape browser. No way to tell without a url.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Nazareth - This Flight Tonight




Reply With Quote
  #5  
Old   
Els
 
Posts: n/a

Default Re: DHTML problem with 2-col + footer CSS Layout - 03-15-2005 , 09:15 AM



Martin! wrote:
Quote:
Xavier Onassis wrote:
"Els" <els.aNOSPAM (AT) tiscali (DOT) nl> wrote in message
news:Xns9619AD855323FEls (AT) 130 (DOT) 133.1.4...
Xavier Onassis wrote:

(topposting sucks but inconsistancy sucks even harder)
That's when you 'correct' the toppost, as I've done below:
Message to OP: please type your reply below the stuff you're
replying to.

Quote:
I would be grateful for recommendations for a CSS layout
(header, 2 cols, footer) that can accomodate dynamically
added elements. I am not having any luck so far getting
this to work in Mozilla/Firefox. Success so far only with
IE. In Mozilla/Firefox, the layout does not adjust when
nodes are inserted into the document dynamically.

Layout:

H E A D E R
COL1 COL2
F O O T E R

[snip long story without relevant information]

A url would actually show the problem

Sorry, I cannot provide a URL at this point. The problem
is on an internal page of our company webserver and
involves a database. I understand that lack of a URL makes
it very difficult to help and am grateful that you took
a crack at solving the problem anyway. For anyone else who
may have seen this problem, I will try to make a long
story short.

My column2 contains a treeview.
That's most likely irrelevant.

Quote:
When the page first
displays, everything is OK. Header, Col1, Col2, and Footer
are all in the right place. When a treenode is clicked for
the first time, its children nodes are fetched from a
database and corresponding HTML elements (DIVs) are
inserted into the document as children of the clicked node
(also a DIV):

DIV class='treenode'></DIV
DIV class = 'treenode'> <!--this node has been expanded
by the user and so contains child elements--
DIV class='fetchedtreenode'> </DIV
DIV class='fetchedtreenode'> </DIV
DIV class='fetchedtreenode'> </DIV
ET CETERA...
/DIV

Thus, col2's contents "grow" dynamically at runtime. This
is where the problem enters. In Mozilla/Firefox, the
fetched nodes display where they should, but the footer is
behaving as though it has been given a POSITION:ABSOLUTE
style, but it hasn't:

#ftr {clear: both; height : 25px;
position: relative;
background : #c0c0c0;
color : #333333;
border : medium solid black;
border-width : 1px 0 0;
margin : 0;}

The footer is staying put even as col2 expands, and the
effect is that some of the fetchedtreenodes display below
the footer.
And what is the value for the position property for those
expanded divs? And for any other code in that 2nd column?

Quote:
it is indeed difficult to make a complete picture of your
problem this way. it would indeed be a lot better if you
would at least show a layout example or 2 (with/without
problem) (even preferable when you leave the company
content out).
And then still there's no way of knowing what the OP is doing,
as it only shows what he wants and what happens, but not why.
The minimum will have to be the code and the CSS.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -


Reply With Quote
  #6  
Old   
Xavier Onassis
 
Posts: n/a

Default Re: DHTML problem with 2-col + footer CSS Layout - 03-16-2005 , 07:53 AM



OK. I will try to put something together that demonstrates the issue. In the
meantime, a followup question. Does a dynamically inserted element inherit
the styles of its parent element if it has no styles of its own?
Xavier







Reply With Quote
  #7  
Old   
Steve Pugh
 
Posts: n/a

Default Re: DHTML problem with 2-col + footer CSS Layout - 03-16-2005 , 08:02 AM



"Xavier Onassis" <xavieronassis (AT) nospam4me (DOT) com> wrote:

Quote:
Does a dynamically inserted element inherit
the styles of its parent element if it has no styles of its own?
If those styles are inheritable, yes.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #8  
Old   
Xavier Onassis
 
Posts: n/a

Default Re: DHTML problem with 2-col + footer CSS Layout - 03-17-2005 , 09:28 AM



Thank you, Steve.

I have discovered the cause of the problem in Mozilla/Firefox. I had been
setting the width of the dynamically inserted child element to 100%,
thinking that this CSS would be interpreted to mean 100% of the parent
container. When I removed that width instruction, the dynamically inserted
DIV's contents no longer extend below the footer.

Xavier


"Steve Pugh" <steve (AT) pugh (DOT) net> wrote

Quote:
"Xavier Onassis" <xavieronassis (AT) nospam4me (DOT) com> wrote:

Does a dynamically inserted element inherit
the styles of its parent element if it has no styles of its own?

If those styles are inheritable, yes.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.