Framework7: How to get pinch to zoom on page-content with hammer.js?

旧街凉风 提交于 2019-12-23 05:43:30

问题


I would like to use pinch to zoom on page-content.

I tried this in myapp.js but it still does not work. Did i forget something? jquery, hammer js and jquery hammer js (wrapper) are initialized

var mc = $(".page-content").hammer();
mc.add(new Hammer.Pinch({
    threshold: 0
}));

回答1:


There are two problems in your question:

  1. How to handle pinch with hammer
  2. How to properly zoom using Javascript + CSS

I posted an answer to a similar question about zooming in Javascript + CSS (which is your problem #2), and luckily, I used Hammer to zoom (which is your #1).

You should therefore find everything you need in this answer: https://stackoverflow.com/a/37842610/838712



来源:https://stackoverflow.com/questions/37354963/framework7-how-to-get-pinch-to-zoom-on-page-content-with-hammer-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!