0

I am making a web app for Tizen. I want to get the x,y coordinates of where the user presses, and then where they release. My code works fine in a browser, but when I run it on Tizen the mouse down function only fires when I release the click

    $("#listener").mousedown(function(e) {  
    mouseDown.x = e.offsetX;
    mouseDown.y = e.offsetY;
    $( "#game" ).css("background-color","#0F0");
});

$("#listener").mouseup(function(e) {
    mouseUp.x = e.offsetX;
    mouseUp.y = e.offsetY;
    $( "#game" ).css("background-color","#F00");
}); 

To make sure it wasn't just an issue with the coordinates I added the background colour change. On a browser the background will turn green while the listener is being clicked, however on Tizen there is no change until the click is released; then it will flicker green for a second and then back to red.

Chimeara
  • 695
  • 7
  • 27

1 Answers1

1

Since Tizen is a mobile based OS, i would refrain from using "mouse" events. Use touch events instead. For example, touchstart, touchmove, touchend.

How to recognize touch events using jQuery in Safari for iPad? Is it possible?

Community
  • 1
  • 1
Rob Graham
  • 98
  • 6