我们在开发移动端应用的时候在使用scroll事件利用forEach的时候不执行
原因是:
某些浏览器不支持forEach 像(uc 魅族自带 和微信等等) 所有我们要减少使用forEach改用for循环 /* ti.forEach(function (e, i) {
// console.log(e.offsetTop)
if (thisST >= e.offsetTop) {
// console.log(i)
asIndex = i;
}
}); */
for (var i = 0; i < ti.length; i++) {
if (thisST >= ti[i].offsetTop) {
// console.log(i)
asIndex = i;
}
};