Merge pull request #2880 from yurydelendik/clientTop
Takes top border width in account (cont #2874)
This commit is contained in:
commit
9759124dd1
@ -63,7 +63,8 @@ function scrollIntoView(element, spot) {
|
|||||||
// Assuming offsetParent is available (it's not available when viewer is in
|
// Assuming offsetParent is available (it's not available when viewer is in
|
||||||
// hidden iframe or object). We have to scroll: if the offsetParent is not set
|
// hidden iframe or object). We have to scroll: if the offsetParent is not set
|
||||||
// producing the error. See also animationStartedClosure.
|
// producing the error. See also animationStartedClosure.
|
||||||
var parent = element.offsetParent, offsetY = element.offsetTop;
|
var parent = element.offsetParent;
|
||||||
|
var offsetY = element.offsetTop + element.clientTop;
|
||||||
if (!parent) {
|
if (!parent) {
|
||||||
console.error('offsetParent is not set -- cannot scroll');
|
console.error('offsetParent is not set -- cannot scroll');
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user