How do I disable scrolling on an iPad webapp?

后端 未结 1 1597
一向
一向 2021-01-30 23:12

The usual:

document.body.addEventListener(\'touchmove\',function(event){event.preventDefault();},false); 

isn\'t working for me. I am trying to

1条回答
  •  囚心锁ツ
    2021-01-30 23:56

    Put that handler on the document element directly, not on the body.

    I've had success with the following:

    
    
    
    

    Then with jQuery:

    $(document).bind('touchmove', false);
    

    This will also be useful if you want to handle different orientations:

    
    
    
    

    0 讨论(0)
提交回复
热议问题