Old thread, but I thought I could throw my 2 cents since I am working on it, and since .bind () is deprecated in favor of .on () and other funny things:
var myScroll;
var myScrollObjectID = "wrapper";
$(document).ready(function() {
setTimeout(function() {
myScroll = new iScroll(myScrollObjectID);
console.log("iScroll object set: ", myScroll, myScrollObjectID);
}, 200);
$("#" + myScrollObjectID).on("touchmove", function(e){
e.preventDefault();
var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
console.log('document->touchmove', e, touch);
});
console.log("jQuery->document->ready");
});
Of course, the “#wrapper” binding means that I still have to deal with touchmove events in the header and footer that are not controlled by the iScroll object, but if that happens, I will capture the event on the “body” since then all three divs should “bubble” into the body object.
source
share