Reputation: 203
jQTouch sometimes fires my click event two times which result in another element (often a link) getting clicked in the panel that shows immediately following a transition.
This issue has been discussed fairly extensively here but there is still not a good solution that I am aware of. In the forum sited above one gentleman suggests the following code as a solution but I am afraid that this will not work for me since I am using swipe and tap events:
allowClick = true;
function preventGhostClick(){
allowClick = false;
setTimeout(function(){
allowClick = true;
},800);
}
$('#element').bind('tap',function(){
if(!allowClick) return false;
app.utils.preventGhostClick();
// do stuff
});
Does anyone have any experience with this issue and any better solutions than the one above? Much thanks!
Upvotes: 2
Views: 855
Reputation: 166
I'm seeing this issue on iPad only, perhaps related to a version of webkit. I've seen two solutions on the web I wanted to share.
Upvotes: 0
Reputation: 894
Have you tried changing from tap events to either click or touchstart or touchend events? I recall having a very similar problem to this with an iPad webapp and fixing it by changing my events to one of those. Sorry I don't remember specifically, but it's worth a shot.
Upvotes: 1