W3C home > Mailing lists > Public > public-html-comments@w3.org > May 2008

Re: [whatwg] scrollIntoView jarring?

From: Neil Deakin <enndeakin@gmail.com>
Date: Wed, 30 Apr 2008 19:25:52 -0400
Message-ID: <48190000.5040701@gmail.com>
CC: whatwg@whatwg.org, W3C WAI-PFWG <w3c-wai-pf@w3.org>, public-html-comments@w3.org

>
> Firefox seems to have an internal check for isElementInView, because
> calling scrollIntoView(false) after scrollIntoView(true) does nothing.
> e.g. "scroll only if it's not visible at all"
>
>   
Firefox 2 uses:

scrollIntoView(true)
  scroll the element and its containers vertically such that the element 
is aligned along the top edge
scrollIntoView(false)
  scroll the element and its containers vertically such that the element 
is fully visible, if possible. If it is already fully visible, don't 
scroll at all. This is like an ensureElementIsVisible type function.

Horizontally, the ensureElementIsVisible behaviour is always used.

Firefox 3 changed the vertical behaviour to be compatible with IE, 
although I personally think the Firefox 2 behaviour is more useful.
Received on Thursday, 1 May 2008 15:49:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:13:58 GMT