Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
442 views
in Technique[技术] by (71.8m points)

iscroll scrollEnd事件不触发,但是scroll事件和scrollStart事件正常触发

我的测试代码:

var myScroll = new IScroll("#wrapper", {
  probeType: 2,
  preventDefault: false,
  interactiveScrollbars: true,
  useTransform: true
});


var scrollF = function() {
  console.log(this.y, this.maxScrollY, "scroll");
}

var scrollEndF = function() {
  console.log(this.y, this.maxScrollY, "scrollEnd");
}

myScroll.on('scroll', scrollF);

myScroll.on('scrollEnd', scrollEndF)

发现每次滚动的时候打印结果为:

clipboard.png

具体渲染内容:

clipboard.png
内部的li是后面异步加上去的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

重新写一遍解决了,不知道为什么=-=


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...