Question

I did a draggable div on the mobile browsers with touchstart, touchmove and touchend, but i have one problem.
When I drag the div, the whole screen is moving, how can I do that when I am touching the div and I am moving my finger, the screen will not move?

Was it helpful?

Solution

You need to bind an event to document for browser to stop its default behavior.

$(document).bind('touchmove' , function()
{
    return false;
});

OTHER TIPS

I am using this library which is working very well on mobile : http://touchpunch.furf.com/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top