简体   繁体   中英

Using Hammer Pinch in Firefox directed wrongly - works in all other browsers

I am using Hammer to detect a pinch on an HTML5 page and direct it to an SVG image for zooming. The SVG image is in its own div and the Hammer pinch detection is attached to that div.

This works fine on the latest versions of IE, Safari (mobile and desktop), Opera and Chrome but not on Firefox. On Firefox, the pinch is not detected by Hammer and thus is not directed to the SVG element. It instead zooms other items on the page.

I am also using Hammer to detect a pan action (again on the SVG) and this works properly on all browsers including Firefox.

So I think I am just missing some Firefox directive to prevent it from capturing the pinch event before Hammer sees it.

I do notice however that it doesn't work using Firefox on the Hammer touch test page so maybe it is a Firefox fix I need to wait for.

This link might help what's the situation is for firefox now regarding pinch zoom. https://bugzilla.mozilla.org/show_bug.cgi?id=1052253 .

Pinch zoom(just for the svg element) works great in chrome. In IE I used jquery.panzoom.js,ie-touch.js for zooming for now. But for Firefox I don't have a clue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM