[thelist] DHTML Scrolling Area
Lee Kowalkowski
lee.kowalkowski at googlemail.com
Mon Jan 14 04:35:44 CST 2008
On 11/01/2008, Noah St. Amand <noah at tookish.net> wrote:
> There's one thing that's still bugging me, though it's not a huge
> deal. In order to make it work, I have to know the width of the
> contents, which comes from box.scrollWidth:
>
> I usually use an addEvent function to attach scripts to window.onload,
> rather than using <body onload="">. In this case, though, when I run
> the script at window.onload, box.scrollWidth returns the width of
> "box", rather than the width of "contents" with everything loaded into
> it. If I call it in the body tag using "onload", box.scrollWidth
> returns the width of "contents".
Strange, it shouldn't really matter. Unless you're accidentally
invoking initScroll instead of assigning it to the onload event, e.g:
addEvent(window, 'load', initScroll()); // accidental immediate invokation.
addEvent(window, 'load', initScroll); // initScroll invoked when
onload event fires.
--
Lee
More information about the thelist
mailing list