This gist provides a simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded that can be called on DOM elements. ... <看更多>
Search
Search
This gist provides a simple JavaScript implementation of the non-standard WebKit method scrollIntoViewIfNeeded that can be called on DOM elements. ... <看更多>
Old question, but it seems still relevant on browsers today (IE, Fx). So I wrote some polyfill for scrollIntoViewIfNeeded() . if (!Element.prototype. ... <看更多>
var parent = document.getElementById('instance1'), list = parent.children, node = list[Math.floor(Math.random() * list.length)]; scrollIntoViewIfNeeded(node, { ... ... <看更多>