Explorar o código

fix safari, edge seek time error

chenyuming %!s(int64=6) %!d(string=hai) anos
pai
achega
53660400c2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/js/utils.js

+ 1 - 1
src/js/utils.js

@@ -48,7 +48,7 @@ const utils = {
     * getBoundingClientRect 在 Opera 10.5 及以下返回的值缺失 width、height 值
     */
     getBoundingClientRectViewLeft (element) {
-        const scrollTop = document.documentElement.scrollTop;
+        const scrollTop = window.scrollY || window.pageYOffset || document.body.scrollTop + (document.documentElement && document.documentElement.scrollTop || 0);
 
         if (element.getBoundingClientRect) {
             if (typeof this.getBoundingClientRectViewLeft.offset !== 'number') {