br0ken- / jtap Goto Github PK
View Code? Open in Web Editor NEWTap Event for jQuery
Home Page: http://BR0kEN-.github.io/jTap/demo
License: MIT License
Tap Event for jQuery
Home Page: http://BR0kEN-.github.io/jTap/demo
License: MIT License
referring to https://github.com/BR0kEN-/jTap/issues/4
code says, .on nativeEvent.end
// Coordinates, when event ends, should be the same as they were
// on start.
(
eventData.pageX === eventData.event.pageX &&
eventData.pageY === eventData.event.pageY
)
so your finger can not slip a pixel.
other libs use ~10px.
in effect, you get a pseudo-hover state on mobile without getting a tap event fairly often.
It would be great to have a unified solution for mobile (touch
) and desktop (click
). Can this be used?
Tapping an element, i.e. a close button, causes the element behind it which is made visible by the close, to receive the tap event as well.
.. and triggering a tap does not trigger a click either
This is probably as intended. But it may be useful to add that to the description, because people may simply replace all 'click' handlers ( $(foo).on('click'...
) with 'tap' handlers, forgetting that somewhere in the application someone may be triggering the event by code ( $(foo).trigger('click'...
), which has to be replaced too, then, into $(foo).trigger('tap'...
)
if i bind tap event on «a» link element, for example, e.preventDefault() not work.
Even with the online demo the first tap doesn't work sometimes. You have to tap again to trigger the tap. That has to be a bug because it's frustrating user experience.
when after I touch,I just move a little bit,then it become invalid usually
Я вешаю событие tap
$('body').delegate('.right', 'tap', fun);
как сделать undelegate ?
У меня сайт с ajax подгрузкой страниц и скриптов.
$('body').undelegate('.right', 'tap');
$('body').delegate('.right', 'tap', fun);
$('body').undelegate('.right', 'tap');
$('body').delegate('.right', 'tap', fun);
fun вызовет 2 раза
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.