iPhone(JavaScript)でジェスチャ中にScrollを禁止

written by shn, on Aug 9, 2010 7:24:00 PM.

iPhone OS3系だと、touchmove中にスクロールしちゃって困ってた。(iOS4だと閾値が違うのかまぁ普通に動く)

phonegap / Preventing-Scrolling-on-iPhone-Phonegap-Applications

<script type="text/javascript">
touchMove = function(event) {
    // Prevent scrolling on this element
    event.preventDefault();
}
</script>
<body>
    <div id="container" ontouchmove="touchMove(event);">content goes here</div>
</body>

Leave a Reply