Possible to disable @media queries or force a resolution? Reason: Allow an iphone to see the desktop site?

前端 未结 4 686
半阙折子戏
半阙折子戏 2020-11-30 01:07

I have my site HEAVILY modified via @media queries to display very slimdown\'d on mobile phones. However, my users are asking for the desktop version of the site (available

4条回答
  •  隐瞒了意图╮
    2020-11-30 01:52

    I had the same issue with a client. But the problem was there were 120+ CSS files contained the media queries. So what I did is, set the viewport width. I have used this snippet on that site and working fine. Using this, even you can give the option for the users to toggle between responsive design and non-responsive design.

    $(document).ready(function(){
       $('meta[name="viewport"]').prop('content', 'width=1440');
    });
    

    Note: 1440 is your preferred screen width.

    Hope this helps :)

提交回复
热议问题