Min's blog

I choose to see the beauties in the world.

导航

常用兼容处理

Posted on 2018-03-29 16:30  Min77  阅读(100)  评论(0编辑  收藏  举报
1. //iphone下设置元素宽度
function setWidth(){
var clientWidth = document.documentElement.clientWidth;
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
$("#index-main-container").css("width",clientWidth);
$('iframe').css("width",clientWidth);
}
}