Anybody familiar with zepto?
I'm open to other mobile frameworks suggestions,too if they have good implantation of doubleTap and they handle the job.
I need to detect coordinates on the second tap of doubleTap event in mobile Safari.
So far I've been using jQuery for the event-obj and that syntax was fine
x: e.pageX
y: e.pageY
But it doesn't work in iPad
Appreciate any kind help, BR
As I've mentioned I found a solution so I'm posting it if other users face the same issue:
// double tap (tapped twice within 250ms)
if (touch.isDoubleTap) {
touch.el.trigger('doubleTap')
touch = {}
This code above in zepto.js detects that the touch event was doubleTap and triggers its handler. And here is a little modification:
// double tap (tapped twice within 250ms)
...............
touch.el.trigger('doubleTap', {touch: touch})
overriding it with passing the event as parameter solves the problem. Now the event object is accessible with all its properties including coordinates.
And here is an example how you extract them from defined handler:
Zepto('selector').doubleTap(function(e){
var dblTap = e.data.touch;
var coord = {
x: dblTap.x1,
y: dblTap.y1
}
});
This is valid for v1.0.rc1 don't know what the case will be in future releases