September 17, 201313 yr Hi, Is there a way to trigger the meta viewport tag based on the viewport width? Something like: if viewport (or client width?) > 500 <meta name="viewport" content="initial-scale=1"> What I'm aiming to do is set the scaling to 1 for mobile devices only. Maybe there's another way to do it. Thanks for your help!
September 18, 201313 yr Author I found what I was looking for eventually. If anyone is interested it's this: <meta id="Viewport" name="viewport" content="width=500, initial-scale=1, user-scalable=yes"> <script> if (screen.width > 500) { var mvp = document.getElementById('Viewport'); mvp.setAttribute('content','width=device-width, initial-scale=.75, user-scalable=yes'); } </script>
Create an account or sign in to comment