BODY.scrollTop = 0 When CompatMode=BackCompat and BODY.style.overflow=hidden.

Hello

When the CompatMode is BackCompat (DOCTYPE), I use the BODY element for to get the scrollTop; but, when the style of the BODY is overflow=hidden, the scrollTopis always 0. The same for the HTML.

So, when the CompatMode is BackCompat and the overflow of the BOBY is 'hidden', How can I get the scrollTop?

This from C# whith MSHTML interfaces.

The same for CSS1compat and HTML.

Thanks

Deza

[469 byte] By [Deza] at [2008-1-29]
# 1

For example:

void explorer_DocumentCompleteE(object pDisp, ref object URL)

{

// domDocument is the IHTMLDocument2 with the DOM Document

IHTMLDocument5 doc5 = (IHTMLDocument5)domDocument;

if (doc5.compatMode.Equals("CSS1Compat"))

{

if (domDocument.body.style.overflow.Equals("hidden"))

{

IHTMLElement2 body = (IHTMLElement2)domDocument.body;

/*********************

* Here: The body.scrollTop always is 0

* How can I get correct scrollTop ?

*********************/

}

}

}

Thanks
Deza at 2007-8-31 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Extension Development...
# 2

Hi Deza,

Could you tell me a little bit more about how your HTML looks like? Because by default, if no scrolling happens to the content of the body, the value of scrollTop is 0.

thanks

Yin

_Yin_ at 2007-8-31 > top of Msdn Tech,Internet Explorer Development,Internet Explorer Extension Development...