js判断手机访问还是电脑访问
if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iOS|iPad|Backerry|WebOS|Symbian|Windows Phone|Phone)/i))) {
document.write("手机访问.");
}else{
document.write("电脑访问.");
}
附上html5简单Demo
理财专家if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iOS|iPad|Backerry|WebOS|Symbian|Windows Phone|Phone)/i))) {
document.write("手机访问.");
}else{
document.write("电脑访问.");
}
附上html自适应引入别人网站代码
好看的电视剧电影body{
margin:0;
padding:0;
overflow: hidden;
}
$(function(){
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
$("#gd").css("display","")
} else {
$("#gd").css("display","none")
}
changeWH();
});
function changeWH(){
$("#myiframe").height($(document).height());
$("#myiframe").width($(document).width());
}
window.οnresize=function(){
changeWH();
}