GithubHelp home page GithubHelp logo

Comments (2)

daffl avatar daffl commented on June 26, 2024

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.

rjgotten avatar rjgotten commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.