Lag on your jQuery Mobile click/touchstart events? Try tap.

If you have lag on click/touchstart handlers in the PG Build of your jQuery Mobile based UI, try switching to the jQM tap event:


$("#mybutton").live("tap", onButtonTap);

function onButtonTap(e)
{
e.preventDefault();
var id = e.target.id;
alert(id);
}



I had serious lag (up to a second) using the click and touchstart handlers, whatever the $.mobile.useFastClick setting was.

Note: without the e.preventDefault() the event is sometimes triggered twice.

HTH
1 person likes
this idea
+1
This topic is no longer open for comments or replies.