pressure.js

iOS 3D Touch API using Javascript for Web App

限于喜欢 提交于 2019-12-02 04:41:46
The iPhones 6s has 3D touch API for native apps. I was wondering if Apple has enabled 3D touch access from Javascript for a web app? Just like we use standard touch events element.addEventListener("touchstart", handleStart, false); Safari 9 supports it on desktop. See Responding to Force Touch Events from JavaScript in Apple's WebKit DOM Programming Topics. I can't find any documentation on using it from Safari 9 on iOS, though. You CAN use force touch on BOTH iPhone and Mac. You can use the the JS library Pressure.js . It makes it really easy to get Force and 3D Touch values on iOS and OSX if