T
Tony T
I'm not a regular here - strictly an amateur web developer - but I've got so
frustrated I'd really appreciate any help anyone can give. I'm working on a
PC platform with Win ME.
I'm developing a new set of web pages, using html4.01 strict with css2
stylesheets. As part of the design, I need to be able to monitor and measure
the vertical scrolling of my document in the viewport. I have got this to
work with up-to-date Netscape and Opera browsers using window.pageYOffset,
but good ol' IE6 has me stumped. My actual pages validate for both html and
css, and I've got other arrangements for earlier and other browsers, so it's
just IE6 that's the problem. Please take a look at these stripped-down
examples (also valid) -
http://rnetworks2002.users.btopenworld.com/scrolltest_nodoc.html and
http://rnetworks2002.users.btopenworld.com/scrolltest_strict.html
You'll see that in the first case, with no DOCTYPE declaration,
document.body.scrollTop returns a value according to the scroll position. In
the second case, with the DOCTYPE declaration, doc.body.scrollTop no longer
varies.
I need the strict doctype for the pages to render correctly with my
stylesheet, so I can't just get rid of the doctype, nor do the pages or
doc.body.scrollTop work if I change the DOCTYPE to transitional (with or
without dtd url). Dropping the url from the strict DOCTYPE doesn't affect
the behaviour of document.body.scrollTop.
I've tried my usual resources (as well as a search here) for ideas, but
without success. So, please can anyone tell me either how to get scrollTop
to work with a strict doctype declaration, or some other way to monitor
scrolling which works in IE6 and html4.01 strict.
Thanks for any help.
frustrated I'd really appreciate any help anyone can give. I'm working on a
PC platform with Win ME.
I'm developing a new set of web pages, using html4.01 strict with css2
stylesheets. As part of the design, I need to be able to monitor and measure
the vertical scrolling of my document in the viewport. I have got this to
work with up-to-date Netscape and Opera browsers using window.pageYOffset,
but good ol' IE6 has me stumped. My actual pages validate for both html and
css, and I've got other arrangements for earlier and other browsers, so it's
just IE6 that's the problem. Please take a look at these stripped-down
examples (also valid) -
http://rnetworks2002.users.btopenworld.com/scrolltest_nodoc.html and
http://rnetworks2002.users.btopenworld.com/scrolltest_strict.html
You'll see that in the first case, with no DOCTYPE declaration,
document.body.scrollTop returns a value according to the scroll position. In
the second case, with the DOCTYPE declaration, doc.body.scrollTop no longer
varies.
I need the strict doctype for the pages to render correctly with my
stylesheet, so I can't just get rid of the doctype, nor do the pages or
doc.body.scrollTop work if I change the DOCTYPE to transitional (with or
without dtd url). Dropping the url from the strict DOCTYPE doesn't affect
the behaviour of document.body.scrollTop.
I've tried my usual resources (as well as a search here) for ideas, but
without success. So, please can anyone tell me either how to get scrollTop
to work with a strict doctype declaration, or some other way to monitor
scrolling which works in IE6 and html4.01 strict.
Thanks for any help.