Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

detect web page scroll position

100 views
Skip to first unread message

steve

unread,
Mar 19, 2003, 4:20:27 PM3/19/03
to
I can't detect IBM web page scroll down position by using
IHTMLElement2 Interface. I can detect other web site
scroll position by using IHTMLElement2 Interface.
Does anyone know how to fix this problem?

Igor Tandetnik

unread,
Mar 19, 2003, 4:53:33 PM3/19/03
to
Their page uses <!DOCTYPE> directive to switch IE6 to strict
standard-compliant mode. In pre-standard mode, the body represents the
scrollable region, so you can retrieve the scroll position with
document.body.scrollTop. In standard mode, HTML element is scrollable,
so you should use document.documentElement.scrollTop
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken

"steve" <rca...@hotmail.com> wrote in message
news:1ef801c2ee5d$5cdecdf0$3401...@phx.gbl...

steve

unread,
Mar 19, 2003, 6:38:08 PM3/19/03
to
Hi Igor,

Could you give me more details?
What's document.documentElement - IHTMLDocument2 or ...?
Thanks.

steve

>.
>

Igor Tandetnik

unread,
Mar 19, 2003, 6:53:40 PM3/19/03
to
IHTMLDocument3

--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken

"steve" <rca...@hotmail.com> wrote in message

news:1f8001c2ee70$98655200$3301...@phx.gbl...

steve

unread,
Mar 20, 2003, 1:24:40 PM3/20/03
to
How to detect scroll position from multiple frames web
page, such as www.vovida.org?
I can only detect left side scroll position but not right
hand side position. I use
IHTMLDocument2, IHTMLElement2 to get scroll position.

Thanks.

steve

>.
>

Igor Tandetnik

unread,
Mar 20, 2003, 1:51:19 PM3/20/03
to
For this particular page, the following works:

frames(0).document.body.scrollTop
frames(1).document.documentElement.scrollTop

--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken

"steve" <rca...@hotmail.com> wrote in message

news:1e4501c2ef0d$f89bf960$a501...@phx.gbl...

steve

unread,
Mar 20, 2003, 5:16:44 PM3/20/03
to
Hi Igor,

Thanks for your reply. Which function I should use for
regular multiple frames?

Thanks.

steve

>.
>

Igor Tandetnik

unread,
Mar 20, 2003, 5:31:03 PM3/20/03
to
Are there "irregular" frames? I don't quite understand the question.

--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken

"steve" <rca...@hotmail.com> wrote in message

news:1fa701c2ef2e$64376040$a501...@phx.gbl...

steve

unread,
Mar 21, 2003, 6:52:01 PM3/21/03
to

Do we use "frames.document.documentElement"for multiple
frames web page?
That's what I mean.

How do you know vovida use "frames(0).document.body" for
the 1st frame? How to detect these kind of web pages?
Thanks.

steve

>.
>

Igor Tandetnik

unread,
Mar 21, 2003, 7:50:02 PM3/21/03
to
It does not depend on whether the page has multiple frames or not. It
depends on whether or not a particular HTML document has appropriate
<!DOCTYPE> declaration at the top. The same frame can at one time have a
regular page loaded, and later have a strict mode page loaded. It just
so happens that on www.vovida.org, left frame is in regular mode and
right frame is in strict mode.

It looks like the following will be pretty reliable:

var top = document.body.scrollTop + document.documentElement.scrollTop;

Either one or the other additive, depending on the mode, is going to be
zero.


--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken

"steve" <rca...@hotmail.com> wrote in message

news:26a801c2f004$de436790$a301...@phx.gbl...

0 new messages