htc hero javascript touch event question


Last Updated:

  1. su301

    su301 New Member This Topic's Starter

    Joined:
    Mar 7, 2010
    Messages:
    2
    Likes Received:
    0
    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 New Member

    Joined:
    Feb 21, 2011
    Messages:
    1
    Likes Received:
    0

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

Share This Page

Loading...