How to reset viewport scaling without full page refresh?

前端 未结 2 822
野的像风
野的像风 2021-01-05 14:38

I have a web-page that has the \"user-scalable\" attribute of the viewport meta tag set to true (Safari reference, Android reference). So users with browsers that recognize

相关标签:
2条回答
  • 2021-01-05 14:44

    Pretty simple deal to set the viewport using jQuery:

    $('meta[name=viewport]').attr('content', 'width=device-width, initial-scale=1');
    

    This works on Mobile Safari using jQuery Mobile as a framework.

    0 讨论(0)
  • 2021-01-05 15:11

    After loading the page most browsers will ignore changing the viewport. Opera will do it, Fennec and Android won't, if I remember my own tests with a faked body correctly.

    0 讨论(0)
提交回复
热议问题