纸上扫雷 8 年之前
父节点
当前提交
9956896401
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/components/header.vue

+ 1 - 1
examples/components/header.vue

@@ -259,7 +259,7 @@
       scroll(() => {
         if (this.isHome) {
           const threshold = 200;
-          let alpha = Math.min(document.body.scrollTop, threshold) / threshold;
+          let alpha = Math.min((document.documentElement.scrollTop || document.body.scrollTop), threshold) / threshold;
           this.$refs.header.style.backgroundColor = `rgba(32, 160, 255, ${ alpha })`;
         }
       });