可以禁用@media查询或强制解析?原因:允许iPhone查看桌面版网站? [英] Possible to disable @media queries or force a resolution? Reason: Allow an iphone to see the desktop site?

查看:261
本文介绍了可以禁用@media查询或强制解析?原因:允许iPhone查看桌面版网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的网站HEAVILY通过@media查询修改显示非常slimdown'd在手机上。但是,我的用户要求的网站的桌面版本(通过链接可用)。



更进一步,桌面网站本身也会被@media查询修改,具体取决于分辨率。我在想选择一个桌面分辨率,说1440x900,并迫使手机以该分辨率显示?



这可能吗,maybee通过jscript?或者,这些@media查询可以完全禁用吗?



谢谢!

解决方案

。但问题是有120+ css文件包含媒体查询。所以我做的是,设置视口宽度。我在这个网站上使用这个片段,工作正常。使用此选项,即使您可以为用户提供在响应式设计和非响应式设计之间切换的选项。

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

注意:这里,1440是您首选的屏幕宽度。 >

希望这有助于:)


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 via a link).

To go a step further, the desktop site itself also gets modified by @media queries depending on resolution. I was thinking of picking one 'desktop' resolution, say 1440x900 and forcing the mobile phone to display at that resolution?

Is this possible, maybee through jscript? Alternatively, can these @media queries be disabled alltogether?

Thanks!

解决方案

I had the same issue with a client. But 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: here, 1440 is your preferred screen width.

Hope this helps :)

这篇关于可以禁用@media查询或强制解析?原因:允许iPhone查看桌面版网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆