0

I'm using iScroll on a single page in my Jquery Mobile document because it has some touch features and I wanted to prevent the user from accidentally scrolling away from the main content. So I add the event listener

document.addEventListener('touchmove', function(e) { e.preventDefault(); }, false);

But I want this to only effect the main page where I have my iScroll enabled. So I figured I'd use the pageload event to bind the event listend to the specific page I needed.

$('#scroll').bind('pageload', function(){
    document.addEventListener('touchmove', function(e) { e.preventDefault(); }, false);// JavaScript Document
    });

But I still cant get it to work on the one page I want. Any ideas?

4

1 回答 1

1

Never mind, got it

scroll.addEventListener('touchmove', function(e) { 
    e.preventDefault(); }, false);
于 2013-06-20T13:44:29.410 回答