On 1/12/11, jdalton <[email protected]> wrote:
> @Balázs Galambosi:
>
> I detect the scroll element in FuseJS using something similar to:
> http://dl.dropbox.com/u/513327/scrollel/quirks.html
> http://dl.dropbox.com/u/513327/scrollel/standards.html
So you add a div, set it to be 10000px tall, and then remove the div
if the documentElement's *clientWidth* is not 0?
| if (docEl.clientWidth !== 0) {
| // ...
| body.removeChild(div);
| }
I'd say move the removeChild call out of that `if` statement. THough
I'm not sure why you're checking clilentWidth there. SHouldn't that be
a check to clientHeight? I don't get it.
I'd also rename `div` to `testDiv`. Identifier `bs` is good.
>
> It seems to detect it correctly.
In Chrome, I see for both examples:
"Use body's scroll coords? Yes." Yet, the scrollHeight for
documentElement is 10000.
javascript: alert(document.documentElement.scrollHeight);
Chrome/8.0.552.237:
10000
> If both body and docEl will report scroll coords it chooses the docEl.
>
I detected quirks mode by checking the compatMode. SO post here:
http://stackoverflow.com/questions/1493386/how-to-detect-quirks-mode-in-safari-3-0-x/3126645#3126645
Though that is less specific to scroll values, so inferences derived
regarding scroll values won't be as strong as with direct capability
tests.
--
Garrett
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]