I need to capture the double tap event on a jqplot chart.I went throught the below link. http://appcropolis.com/implementing-doubletap-on-iphones-and-ipads/ In jquery.jqplot.js, I inserted the following code :
this.onTouchEnd = function(ev) {
var now = new Date().getTime();
var lastTouch = $(this).data('lastTouch') || now + 1 /** the first time this will make delta a negative number */;
var delta = now - lastTouch;
clearTimeout(action);
if(delta<500 && delta>0){
// the second touchend event happened within half a second. Here is where we invoke the double tap code
alert("Doubletapped");
}else{
// A click/touch action could be invoked here but wee need to wait half a second before doing so.
alert("notdoubletapped");
}
$(this).data('lastTouch', now);
But it doesnt detect the double tap event.
In the case of jqplot, what should 'this' refer to?
Should it refer to ev.data.plot?
$(this).data('lastTouch')