摘要:
根据元素相对位置来控制滚动条http://jsbin.com/ebudaf/2其中用到了Element.prototype.scrollIntoViewIfNeeded代码如下: Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) { centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded; var parent = this.parentNode, parentComputedStyle = window.... 阅读全文