Prevent that a fixed element resizes when zooming on touchscreen

前端 未结 3 1665
萌比男神i
萌比男神i 2020-11-27 15:38

On an HTML website, you have a fixed element like this:

Some content

It has this

3条回答
  •  时光说笑
    2020-11-27 16:07

    I'm looking to do the same thing that @bobsoap was trying to do BUT My solution is the following:

    1. Disable zooming in your viewport tag:

    
    

    2. Use a plugin like: TouchSwipe.js:

    https://github.com/mattbryson/TouchSwipe-Jquery-Plugin

    And only zoom in the Div or divs that you want & suit to your needs.

    I have 2 divs on a page (left & right) The left div has a fixed scrolling menu and the right has small text & images. I want to pinch/zoom and have only the right div zoom so that the user can read the text better if necessary. Rather than make the entire viewport zoomable and disable zoom on my left div, I'm doing exactly the opposite: Make only my right div zoomable via TouchSwipe plugin.

    I'll share my code when I'm done if anyone is interested in how I implemented the TouchSwipe plugin.

提交回复
热议问题