Possible to have both Probe and Zoom functions working in iScroll simultaneously?

203 views Asked by At

iscroll-probe.js is handling some precise scroll-position functionality on my site. But zoom is not available. If I use iscroll-zoom.js instead, the zoom works, but now my probe function doesn't work. It seems I can have one or the other, but not both.

iscroll-probe.js and iscroll-zoom.js seem to be variations on the standard iscroll.js, each adding different features, but no way to have both at the same time. Unless I start hacking into the Javascript myself, of course, and building some kind of hybrid version.

Do I have this right, or is there a workaround to this?

2

There are 2 answers

0
Lars Krafft On

I've had the same problem. I used git to solve it. I created one branch where I replaced all code from iscroll.js with iscroll-probe.js and another one where I replaced all code with iscroll-zoom.js then I merged both into my master and resolved some conflicts by hand.

Not the best solution but it worked.

0
Federico Rossi On

You can use requirejs. See following example:

require(['iscroll-probe'], function(iscroll_probe) {
    window.IScroll = iscroll_probe;
    require(['iscroll-zoom'], function(iscroll_zoom) {
       window.IScrollZoom = iscroll_zoom;
    });
});