473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Doctype strict and IE6 - monitoring scrolling

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.btopenwor...est_nodoc.html and
http://rnetworks2002.users.btopenwor...st_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.
--
Tony T
Replace 'from' with 'to' (twice) for e-mail
Jul 20 '05 #1
2 2005


Tony T wrote:

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.


You are looking for
document.documentElement.scrollTop/scrollLeft
for IE6 in strict rendering mode (check
if (document.compatMode && document.compatMode != 'BackCompat') {
... document.documentElement.scrollTop...
}
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:40********@olaf.komtel.net...


Tony T wrote:

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.


You are looking for
document.documentElement.scrollTop/scrollLeft
for IE6 in strict rendering mode (check
if (document.compatMode && document.compatMode != 'BackCompat') {
... document.documentElement.scrollTop...
}
--

Martin Honnen
http://JavaScript.FAQTs.com/


Martin - thanks. You're a star!
--
Tony T
Replace 'from' with 'to' (twice) for e-mail
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Patrick | last post by:
Hi I am fairly new to CSS and the web.I am trying to build a site more to practice my skills than for the site itself. I have been focusing on CSS and try my best to make it work in I.E 6.0,...
12
by: Robert Misiorowski | last post by:
Hello, I have a very perplexing (at least to me) problem that hopefully someone can help me with. I'm making a site with a 3 column layout. In the middle column (my fluid column) I am trying to...
34
by: The Good Son | last post by:
I'm trying to get my head around a problem that has me baffled. The following element: #wrapper {border:1px solid #000;background:#fff;} Renders as expected when using this DTD: ...
6
by: jperillo | last post by:
When I validate the source of http://www.24stores.com I'm told that I have an incorrect DOCTYPE statement. How can I, or can someone determine what I'm doing wrong !! I have no idea which...
2
by: PapaRandy | last post by:
Hello, I am trying to validate the following .py webpage as HTML (through W3C). I put: ----------------------------------------------------------------------------- print "Content-type:...
15
by: Lennart | last post by:
Hi folks, I have created an animated image gallery in dhtml. It works fine in Internet Explorer. In Firefox, it only works if I ommit the DOCTYPE tag. The page is valid xhtml-strict but with a...
20
by: Deborah | last post by:
I'm trying to clean up my website, and it's in pretty good shape now, but I've gotten confused reading about Doctypes. My site is http://www.simi-therapy.com and my CSS is...
0
drhowarddrfine
by: drhowarddrfine | last post by:
The Doctype or DTD Many coders get confused by all the talk of doctypes and how they affect browsers and the display of their web pages. This article will get right to the point about doctypes...
8
by: pamela fluente | last post by:
I need an opinion. I have to add NEW pages to an existing site. The site has - also - some ASPX pages. These pages, I have seen, have the following doctype: <!DOCTYPE html PUBLIC "-//W3C//DTD...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.