|
Posted by Ben C on October 11, 2006, 11:21 am
Please log in for more thread options
> I have a webpage that has 2 main DIVs - a title div and a content div.
> I want the title dive to always "stick to the top of the page and
>
> not scroll, regardless of the size of the window. The content div
> should have a scrollbar that sits underneath the title div. I have
>
> some event handlers in Javascript that handle calculating the size of
> the content div.
>
> Everything works fine in IE/Firefox when I remove the DTD from my
> document (quirks mode) but in standards mode I get the scrollbar for
> the
>
> whole window and both the content div and title div scroll. The code
> is below. If you comment out the DOCTYPE line to render in qirks
>
> mode you will see the behavior I want.
>
> So my question is: how can I get this page to appear the same way in
> standards mode and quirks mode?
>
> Any help on this is greatly appreciated.
>
[snip]
> var e = document.getElementById("eContentDiv");
> e.style.height = document.body.clientHeight -
> eContentDiv.offsetTop
^^^^^^^^^^^
Here you mean "e" I think. eContentDiv is not the name of any variable.
As for the problem, I think it may be related to
document.body.clientHeight which is non-standard.
Possibly window.getComputedStyle() is the proper one to use.
|