- I have a single page application.
- It uses backbone.js.
- Click mouse events with one click.
- Double-tap events using the touch device.
- Disabling the one-click event stops like on touch devices.
I canβt figure out where to start looking.
This is JS:
$('.classy').on('click', 'button', function(){ console.log('clicked'); })
I need help figuring out how to do this. I know that I have not received enough information to get a real answer. What puzzles me is that this only happens on touch devices. If I accidentally linked two events or created two instances of the same view, would that not be the case for mouse clicks?
Thanks.
EDIT: I tried using the tap event via jQuery Mobile. It had a strange reaction. He once triggered an event and looked like it was done, but the next time you touch anywhere on the screen, he will fire the event again .... weird, any ideas?
I finally found the problem. This came from layered iScrolls. I should have hacked lib at this point, probably a much better way to fix this, but illustrated the gist.
if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA' && window.iScrollClickFIX != true) { window.iScrollClickFIX = true; setTimeout(function(){ window.iScrollClickFIX = false; }, 1)
Thanks for helping everyone.
source share