Page 1 of 1

scrollintoview browser compatibility

Posted: Thu May 04, 2006 11:05 am
by s.dot
Apparently scrollIntoView() is an IE doing, but is also supported by Firefox & Opera.

But Konquerer and Safari do not recognize it, and my script fails to auto scroll to the bottom of a div layer.

Is there a workaround for this? Perhaps by determining the height and width of the div layer and doing something with focus()?

Posted: Thu May 04, 2006 11:15 am
by feyd
HTMLElement.scrollIntoView() in indeed an Internet Explorer addition (IE4+) and was later added to some other browsers as noted.

window.scroll(), window.scrollBy() and window.scrollTo() are DOM supported. The former is Javascript 1.1 and was deprecated by Javascript 1.2 in favor of the latter two methods.

Posted: Thu May 04, 2006 8:37 pm
by s.dot
hmm using window... would this mean I'd have to make it an IFrame to scroll to the bottom?

Posted: Thu May 04, 2006 11:16 pm
by feyd
You scroll the window that contains the element you were formerly calling scrollIntoView() on.