Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
tswj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2022-07-01 20:18:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2c8c23d3e7918722160d6d1a6ce148cd45d6a1f8
2c8c23d3
1 parent
8b0a4bc1
🐞 fix: 修复微信浏览器滚动高度适配问题
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
src/views/client/bookDetail.vue
src/views/client/bookDetail.vue
View file @
2c8c23d
...
...
@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-21 09:35:14
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-07-01
18:07:00
* @LastEditTime: 2022-07-01
20:17:04
* @FilePath: /tswj/src/views/client/bookDetail.vue
* @Description:
-->
...
...
@@ -191,8 +191,14 @@ window.onscroll = function () {
const windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
//变量scrollHeight是滚动条的总高度
const scrollHeight = document.documentElement.scrollHeight||document.body.scrollHeight;
console.warn('scrollTop', scrollTop);
console.warn('windowHeight', windowHeight);
console.warn('scrollTop + windowHeight', scrollTop + windowHeight);
console.warn('scrollHeight', scrollHeight);
//滚动条到底部的条件
if (parseInt(scrollTop + windowHeight) === scrollHeight){
const height1 = scrollTop + windowHeight;
const height2 = scrollTop + windowHeight - 1; // 手机上微信高度少了1px
if (parseInt(height1) === scrollHeight || parseInt(height2) === scrollHeight){
// console.warn("距顶部"+scrollTop+"可视区高度"+windowHeight+"滚动条总高度"+scrollHeight);
customStyle.value.bottom = '35%'
} else {
...
...
Please
register
or
login
to post a comment