admin管理员组

文章数量:1287162

I'm building a web app and I want to disable zooming with multi-touch. I have tried this

<meta name="viewport" content=" width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">

but it's not working. How can I implement this? The app will run on tablets.

I'm building a web app and I want to disable zooming with multi-touch. I have tried this

<meta name="viewport" content=" width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">

but it's not working. How can I implement this? The app will run on tablets.

Share Improve this question edited Feb 14 at 21:19 TylerH 21.1k77 gold badges79 silver badges112 bronze badges asked Jul 22, 2020 at 10:18 SolyzaSolyza 851 gold badge1 silver badge5 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

With React-Helmet you can put your metadata in the render-function of your Component like this:

render(){ 
    return <div>
        <Helmet>
              <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
        </Helmet>
        [...]
    </div>
}

Look at the Helmet documentation for further information.

本文标签: javascriptHow to disable multitouch zoom in React JSStack Overflow