fixed player

This commit is contained in:
DIYgod
2018-03-22 01:34:24 +08:00
parent 20e2bd3e3d
commit a002a4b180
16 changed files with 383 additions and 60 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ const utils = {
return actualLeft - elementScrollLeft;
},
getElementViewTop: (element) => {
getElementViewTop: (element, noScrollTop) => {
let actualTop = element.offsetTop;
let current = element.offsetParent;
let elementScrollTop = 0;
@@ -48,7 +48,7 @@ const utils = {
current = current.offsetParent;
}
elementScrollTop = document.body.scrollTop + document.documentElement.scrollTop;
return actualTop - elementScrollTop;
return noScrollTop ? actualTop : actualTop - elementScrollTop;
},
isMobile: isMobile,