scrollintoview browser compatibility

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

scrollintoview browser compatibility

Post 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()?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

hmm using window... would this mean I'd have to make it an IFrame to scroll to the bottom?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You scroll the window that contains the element you were formerly calling scrollIntoView() on.
Post Reply