写出文档声明的前提下。
当用1,doucment.body.scrollTop火狐不兼容。
2,document.documentElement.scrollTop兼容火狐。
safari我自己写的时候1,是兼容的。
要想都兼容可以这么写。
var scrollTop = window.pageYOffset document.documentElement.scrollTop document.body.scrollTop 0;
然后判断的话直接用scollTop来进行位置判断就完美解决啦
2025 - 快车库 - 我的知识库 重庆启连科技有限公司 渝ICP备16002641号-10
企客连连 表单助手 企服开发 榜单123