在jQuery if / then语句中识别iOS用户代理的简单方法? [英] Simple way to identify iOS user agent in a jQuery if/then statement?
本文介绍了在jQuery if / then语句中识别iOS用户代理的简单方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
完全像听起来..
是否有一些神奇而简单的方式可以说:
Is there some magical and easy way to say:
if (user agent is iOS) {
if (browserRatio >=1.5) {
$container.css('min-height', '360px');
} else {
$container.css('min-height', '555px');
}
}
推荐答案
找到它。
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
if (browserRatio >=1.5) {
$container.css('min-height', '360px');
} else {
$container.css('min-height', '555px');
}
}
这篇关于在jQuery if / then语句中识别iOS用户代理的简单方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文