Comments (2)
So it should use originalEvent.changedTouches
? The only way I could test touch features was using the iOS and Android emulators in Browserstack - which is probably not the most real-life situation.
from jquerypp.
You should use changedTouches
, yes. For 'touchend' events the Touch
instance corresponding to the finger that was removed from the touch surface will only be present in the changedTouches
list. It will not be present in touches
(which represents all active touches on the screen) or targetTouches
(which filters touches
down to those that started on the event's target
element). If you need further reference, there are examples and more information available in the Touch Events CR from the W3C: http://www.w3.org/TR/touch-events/
I find that Chrome's mouse-based touch event emulation provides a good balance between debugging and real-life representation for testing features of single-touch. Click the small gear in the bottom right of the developer tools to go to the options screen and toggle the feature there. Multi-touch is going to be hard to test without an actual touch device.
Btw. To be compatible with multi-touch devices you'll also need to fix the drag, drop and swipe handling. You need to keep track of the unique value of the identifier
property that started the interaction sequence in the 'touchstart' event and use that to retrieve information on the correct touch point in corresponding 'touchmove' and 'touchend' events. You cannot simply assume that the first index in a TouchList is the correct, same touch point every time.
(Also it will be kind of interesting to know the jQuery++ project's stance on msPointer for Internet Explorer 10, which is going to be yet another set of input events to work with...)
from jquerypp.
Related Issues (20)
- Add check for PhantomJS in drag/core so unit tests can be automated.
- CSS Transition attached to dragging element causes ghost to be messed up
- Trying to select a table throws an error on IE 10
- Migrate to new StealJS
- Some source docs are broken HOT 1
- drag does not work with touchmove default prevented HOT 6
- Drop tolerance HOT 6
- Fix "main" in bower.json
- Support for devices with mouse and touch at once HOT 2
- Add NPM link to docs
- z-index set to 1000 when an element is dragged
- Right-positioned elements jump to the left when dragged in Safari
- DoneJS documentation links are broken
- Window moves underneath the cursor when starting a drag with representative() HOT 1
- jQueryPP.com audit
- Minified 2.0.2 throws error HOT 1
- Add a Press Kit section
- Advertise the community survey on jquerypp.com HOT 1
- Documentation link broken HOT 3
- range.js initialization in IE 8/9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquerypp.