1. Download our Official Android App: Forums for Android!

htc hero javascript touch event question

Discussion in 'Android Devices' started by su301, Mar 7, 2010.

  1. su301

    su301 Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Mar 7, 2010

    Mar 7, 2010
    2
    0
    5
    Hi,

    I'm trying to add a javascript which can listen to the 'finger scrolling' event on HTC hero's default browser.

    Which event(s) should my listeners bind to?
    On iPhone's safari browser I can bind to 'touchmove', 'touchend', or 'scroll' event. But on HTC hero the browser DOES NOT ALWAYS fired these events (although occasionally it does).

    I tested it with this script:

    document.addEventListener('touchend',end1,false);
    document.addEventListener('touchmove',move1,false);
    document.addEventListener('touchcancel',cancel1,false);
    document.addEventListener('scroll',scroll1,false);
    function cancel1(event) {
    alert("cancel");
    }
    function move1(event) {
    alert("move");
    }
    function end1(event) {
    alert("end");
    }
    function scroll1(event) {
    alert("scroll");
    }

    I also tried jQuery way, like: $(document).bind("touchmove", touchmove1);
    it doesn't make any differences.

    Here's the browser info:
    webkit:true
    version:528.5
    safari:true

    Thanks in advance for your help,
    Su
     

    Advertisement

  2. gtroop

    gtroop Lurker
    Rank:
    None
    Points:
    5
    Posts:
    1
    Joined:
    Feb 21, 2011

    Feb 21, 2011
    1
    0
    5

    Did you ever resolve this? I have the same problem on a couple of different Android devices, some work fine though!
     
Tags:

Share This Page

Loading...