function IsPC() {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
"iPad", "iPod"];
var flag = false;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = true;
break;
}
}
return flag;
};
var ispc=IsPC();
if (ispc){
$('#images').attr('src','images/move_bg.png');
$('.right_nav').width('120');
}
js判断是否是移动端还是PC端
最新推荐文章于 2024-05-30 15:47:51 发布