记录安卓下滚动不支持document.documentElement的问题

documentElement在安卓手机下不支持,所以需要使用document.body.scrollTop

 

handleScroll() {
	let el = document.documentElement, body = document.body;
	let scroTop = el.scrollTop || body.scrollTop;
	let oHeight = this.$parent.getHeight();
	this.distanceAll = oHeight + this.$refs.describe.offsetHeight;
	if (scroTop >= this.distanceAll) {
		this.isFixed = true;				
	} else {
		this.isFixed = false;
				
	}
}

  


posted @ 2022-08-08 14:49  紫诺花开  阅读(330)  评论(0)    收藏  举报