This commit is contained in:
clay
2022-05-06 17:43:19 +08:00
parent fdca595a49
commit 6276d6c528
2 changed files with 50 additions and 72 deletions

View File

@@ -28,18 +28,6 @@ export default {
}
},
mounted() {
//this.screenWeight = document.documentElement.clientWidth;
//this.screenHeight = document.documentElement.clientHeight;
//this.main = document.getElementById("main");
//this.page2 = document.getElementById("page2");
//this.obj = document.getElementsByTagName("div");
//for (let i = 0; i < this.obj.length; i++) {
// if (this.obj[i].className == 'page') {
// this.obj[i].style.height = this.screenHeight + "px";
// }
//}
//this.pageNum = document.querySelectorAll(".page").length;
// 浏览器兼容
if ((navigator.userAgent.toLowerCase().indexOf("firefox") != -1)) {
document.addEventListener("DOMMouseScroll", this.scrollFun, false);
@@ -77,16 +65,12 @@ export default {
// // 向下滚动
// this.index = 2;
// this.toPage(this.index);
window.scrollTo({top: window.innerHeight+20, behavior: 'smooth',})
console.log(window.innerHeight + 20);
console.log(window.innerWidth/2)
window.scrollTo({top: window.innerWidth/2, behavior: 'smooth',})
} else if (delta < 0 && window.pageYOffset <= window.innerHeight+200) {
// // 向上滚动
//
//
//
//
window.scrollTo({top: 0, behavior: 'smooth',})
// this.index = 1;
// this.toPage(this.index);
}
// // 本次翻页结束,记录结束时间,用于下次判断
this.endTime = new Date().getTime();