Open Tidra opened 2 months ago
6.x
无
进入文章无法显示阅读进度条。
排查步骤: 1、pace的js和css正常加载; 2、搜索主题文件找到pace的调用Pace.bar.update(volantis.scroll.progress() * 100)中的volantis.scroll.progress()的值存在问题,一直是Infinity 3、调试发现volantis.scroll.scrollHeight()和volantis.scroll.offsetHeight()一直相等,但两函数实现并无问题,应该是body样式问题导致无法获取offsetHeight的真实高度 4、body中搜索height样式,只有继承html的height,尝试加入属性height: 100%;,正常显示。
Pace.bar.update(volantis.scroll.progress() * 100)
volantis.scroll.progress()
Infinity
volantis.scroll.scrollHeight()
volantis.scroll.offsetHeight()
height: 100%;
```yml theme: volantis ```
```yml 默认配置 ```
``` v18.19.0 9.2.0 ```
``` hexo-site@0.0.0 /workspace/project/blog ├── hexo-generator-archive@2.0.0 ├── hexo-generator-category@2.0.0 ├── hexo-generator-index@3.0.0 ├── hexo-generator-tag@2.0.0 ├── hexo-renderer-ejs@2.0.0 ├── hexo-renderer-marked@6.3.0 ├── hexo-renderer-stylus@3.0.1 ├── hexo-server@3.0.0 ├── hexo-theme-landscape@1.0.0 ├── hexo-wordcount@6.0.1 └── hexo@7.1.1 ```
不知道是不是我自己环境的问题,但是我看到官方主页body也是有height属性的,建议在body样式里加入height: 100%;
body
检查清单
主题版本
6.x
复现地址
无
问题描述
进入文章无法显示阅读进度条。
排查步骤: 1、pace的js和css正常加载; 2、搜索主题文件找到pace的调用
Pace.bar.update(volantis.scroll.progress() * 100)
中的volantis.scroll.progress()
的值存在问题,一直是Infinity
3、调试发现volantis.scroll.scrollHeight()
和volantis.scroll.offsetHeight()
一直相等,但两函数实现并无问题,应该是body样式问题导致无法获取offsetHeight的真实高度 4、body中搜索height样式,只有继承html的height,尝试加入属性height: 100%;
,正常显示。配置文件
站点配置文件
```yml theme: volantis ```
主题配置文件
```yml 默认配置 ```
环境信息
node.js & npm
``` v18.19.0 9.2.0 ```
package.json
``` hexo-site@0.0.0 /workspace/project/blog ├── hexo-generator-archive@2.0.0 ├── hexo-generator-category@2.0.0 ├── hexo-generator-index@3.0.0 ├── hexo-generator-tag@2.0.0 ├── hexo-renderer-ejs@2.0.0 ├── hexo-renderer-marked@6.3.0 ├── hexo-renderer-stylus@3.0.1 ├── hexo-server@3.0.0 ├── hexo-theme-landscape@1.0.0 ├── hexo-wordcount@6.0.1 └── hexo@7.1.1 ```