473,473 Members | 1,906 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Browsers not supporting document.documentElement.scrollLeft?

Hi,

I just tested all the browsers I have for support of
document.documentElement.scrollLeft to determine how many pixels the
window has been scrolled to the right. I'm trying to determine if I
really need to go to all the trouble of feature detection for determine
page scroll amount of if the old browsers are old enough now just to
ignore them.

Below are the OS-browser combinations that worked in my test.

OS X 10.4
Safari 2.0.4
Opera 9.00
Firefox 1.5.0.6

OS X 10.3
Safari 1.3.2
Opera 9.00
Firefox 1.5.0.6
(Failed in Internet Explorer 5.2)

Windows XP
Internet Explorer 6.0.2600.000.xpclient.010817-1148
Firefox 1.5.0.6
Opera 9.01

IE 6 was released in August 2001 which is a long time ago so worrying
about IE 5 seems unnecessary for some kinds of web sites. And IE 5 on
OS X is a tiny fraction of people surfing the web.

Does anyone know which are the most recent browsers that would not
support document.documentElement.scrollLeft? Any mobile devices or are
they all running something based on Mozilla or Opera?

Thank you,
Peter

Sep 3 '06 #1
2 9455


pe**********@gmail.com wrote:

I just tested all the browsers I have for support of
document.documentElement.scrollLeft to determine how many pixels the
window has been scrolled to the right.
Windows XP
Internet Explorer 6.0.2600.000.xpclient.010817-1148
Note that for IE 6 you will need to use
document.documentElement.scrollLeft if it renders the document in strict
mode but document.body.scrollLeft if it renders the document in quirks
mode. So for IE 6 and later you need to check document.compatMode to
decide whether to use documentElement.scrollLeft or body.scrollLeft. And
it seems Mozilla does the same but there I think window.pageXOffset is a
better choice anyway as I think it will work in older versions of
Mozilla too.

For IE 5 and 5.5 on Windows you need document.body.scrollLeft.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 3 '06 #2
Martin Honnen wrote:
>
I just tested all the browsers I have for support of
document.documentElement.scrollLeft to determine how many pixels the
window has been scrolled to the right.
Windows XP
Internet Explorer 6.0.2600.000.xpclient.010817-1148

Note that for IE 6 you will need to use
document.documentElement.scrollLeft if it renders the document in strict
mode but document.body.scrollLeft if it renders the document in quirks
mode. So for IE 6 and later you need to check document.compatMode to
decide whether to use documentElement.scrollLeft or body.scrollLeft. And
it seems Mozilla does the same but there I think window.pageXOffset is a
better choice anyway as I think it will work in older versions of
Mozilla too.

For IE 5 and 5.5 on Windows you need document.body.scrollLeft.
Hi Martin,

Thank you for the reply. I just read the following page about quirks
mode

http://www.quirksmode.org/css/quirksmode.html

I always have following doctype at the top of my web pages

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

so on modern browsers it seems I don't have to worry about my page
being rendered in quirks mode, correct?

So it looks and could just use documentElement.scrollLeft if I am not
concerned with IE 5, 5.5 or earlier Mozilla.

Do you have any idea which version of Mozilla was the first to
implement documentElement.scrollLeft in strict mode?

Thank you,
Peter

Sep 3 '06 #3

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

Similar topics

2
by: Big D | last post by:
I have this JS to scroll two frames with on scrollbar: <html> <head> <script> var tid; function initScrollSynchronization () { tid = setInterval('syncFrame()', 25); } function syncFrame () {
6
by: Richie | last post by:
I went through the past six months or so of entries in c.l.javascript, and found a couple where people had expressed opinions about the value of supporting much older versions of Netscape and IE. ...
4
by: Cathie | last post by:
Hi All, I am trying to get my style sheet to work. It works fine in IE but I can't get it to work in .net. Below is the function I use for transforming, where advancedOptionsFile is the path...
7
by: dd | last post by:
Hello all. First, I'm a newbie to javascript but not to ASP. Secondly I've been searching for the answer for two hours and I decided to finally post this question. I'm trying to take a...
2
by: P2P | last post by:
Hi I am wondering if someone know of a free cross-browsers vertical scrolling script that - is cross cross-browsers - will call the scrolling content from an external html page or from a...
13
by: RommelTJ | last post by:
Hi, My website (http://www.justiceinmexico.org/indextest.php) looks good in Firefox, but horrible in IE, and I think it's because of an error in the javascript of a free web ticker I got off the...
8
by: Martin Honnen | last post by:
VK wrote: Mozilla has document.height document.width IE has scrollHeight/scrollWidth, depending on compatMode you will need these properties of document.documentElement or document.body --
21
by: Aaron Gray | last post by:
(Please tell me if this is silly or I am barking up the wrong tree) Can someone check this please on pre W3C DOM browsers :- function getDocumentRoot() { for ( e in document.childNodes) if (...
1
by: vunet | last post by:
The code below returns the viewport of the browser window but it does not work in IE7 because of the document.documentElement.clientHeight: function pageHeight(){ return window.innerHeight !=...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.