How to disable tap&drag as scrolling in browser?

Last Updated:

  1. cdehaan

    cdehaan Member

    Hello all. I am making a intranet website that exactly fits the screen of the device it will be used on (Archos 7 home tablet in this case, Android 1.5).

    All browsers (default, dolphin, steel, UC) interpret tap&drag on a website as scrolling. I don't want this. I want it to be registered as mouse actions. Is there a way to do this? :confused: Thanks in advance!

    - Chris

  2. cdehaan

    cdehaan Member

    Well, in case anyone else wants to know how to do this, here's the answer:

    First, register onTOUCH (not onMOUSE) events in the body tag, or wherever you want this behavior. For example:

    <body ontouchstart="touchStartFunction(event);" ontouchmove="touchMoveFunction(event);" ontouchend="touchEndFunction(event);">

    Second, in your ontouchstart event, add the following line:


    Now you can use the touch events. To get the X position of the touch, for example, use this:

    var touch = event.touches[0];
    document.getElementById('touchMoveTextbox').value = "Touch move at " + touch.pageX;

    Hope this helps someone.

Share This Page