Home  >  Q&A  >  body text

javascript - iscroll scrollEnd event does not fire, but scroll event and scrollStart event fire normally

My test code:

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)

It is found that the printed result every time when scrolling is:

Specific rendering content:


The internal li is added asynchronously later

天蓬老师天蓬老师2685 days ago771

reply all(1)I'll reply

  • 黄舟

    黄舟2017-05-19 10:33:22

    I solved it by writing it again, I don’t know why =-=

    reply
    0
  • Cancelreply