This gist provides polyfill code for the scrollIntoViewIfNeeded()
Element method found on WebKit browsers.
There is no particular requirement on the position in the hierarchy of the element being made visible with respect to any scrollable areas. Elements that are relatively positioned as well as nested scrollable areas are both supported.
CoffeeScript version added with an optional offset for scrolling past fixed headers, etc