Framework7: How to get pinch to zoom on page-conte

2019-06-09 01:18发布

问题:

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