Js how to monitor iscroll.js events?

  node.js, question

Js how to monitor iscroll.js events?

Reply:

var myScroll;
 
 function loaded () {
 myScroll = new IScroll('#wrapper', {
 scrollbars: true,
 mouseWheel: true,
 interactiveScrollbars: true,
 shrinkScrollbars: 'scale',
 fadeScrollbars: true,
 onScrollMove: function() {
 console.log('onScrollMove');
 bracket
 });
 bracket
 
 document.addEventListener('touchmove', function (e) { e.preventDefault();   }, false);

Js version of IScroll5 includesOnScroll event, here you need to specify probeType when instantiating to specify the frequency of onScroll event triggering (because this affects performance)

There seems to be such a method in iscroll4:

myScroll = new iScroll('wrapper', {
 onScrollMove: function() {
 console.log('onScrollMove');
 bracket
 });