Firefox disable browser zoom but allow element zoom on pinch

前端 未结 1 341
生来不讨喜
生来不讨喜 2021-01-14 22:30

I\'ve got a site running aimed at touchscreens running Firefox (very specific I know, but it will hopefully help with a solution) On the page in question, I\'ve got a d3 map

相关标签:
1条回答
  • 2021-01-14 23:21

    You might be able to do this using the viewport metatag and Hammer.js

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    

    This will disable the default browser zoom.


    You can then use Hammer.js to capture gesture events which you will then pass to your D3.js code to zoom your map

    0 讨论(0)
提交回复
热议问题