Close

Account

Documentation

Forum

Menu

How to disable zoom in mobile responsive?

  • Post count: 172
    winpeace
    March 16, 2018 at 6:21 am #29640

    Hi,
    this code work android devices but not work ios. Some function codes find on google for this but when add this code to function.php site crashed.
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" >
    how to work on iphones?

    Post count: 10729
    Adek
    March 19, 2018 at 9:56 am #29682

    Hi winpeace,

    Please try to go edit this file wp-content/themes/jnews/header.php and then jump into line 9 and adjust that code with yours.

    Thank you

    Post count: 172
    winpeace
    March 19, 2018 at 11:56 am #29702

    As I said this code not works on iphones. How to work on iphones(safari)

    Post count: 10729
    Adek
    March 20, 2018 at 9:11 am #29727

    Hi winpeace,

    I’m sorry for that, i thought you won’t be able to add that code previously. May i know what the current iOS version that you use for checking? Because i just found on a forum that said user-scaleable=no is disabled in Safari for iOS 10. You can check this thread here https://stackoverflow.com/a/38852262/5192328 for complete information.

    Thank you

    Post count: 172
    winpeace
    March 20, 2018 at 11:53 am #29745

    10.3.1
    document.addEventListener(‘touchmove’, function(event) {
    event = event.originalEvent || event;
    if (event.scale !== 1) {
    event.preventDefault();
    }
    }, false);

    In thread gives this code where to I put this code?

    Post count: 10729
    Adek
    March 21, 2018 at 9:49 am #29780

    Hi winpeace,

    You can try to put that code into Customize > Additional Javascript.

    Thank you

    Post count: 172
    winpeace
    March 21, 2018 at 11:01 am #29790

    Not work any js.
    Any solution for how to disable pinch zoom on ios all site

    Post count: 10729
    Adek
    March 22, 2018 at 9:26 am #29813

    Hi winpeace,

    Unfortunately, at the moment i don’t have any suggestion for this thing yet. I will back to you if I get a solution for this thing.

    Thank you

You must be logged in to reply to this topic.