获取手机尺寸
Posted hurenweb
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获取手机尺寸相关的知识,希望对你有一定的参考价值。
js
<script>
var stra = \'你的浏览器:\' + "<br>";
stra += "代号: " + navigator.appCodeName + "<br>";
stra += "名称: " + navigator.appName + "<br>";
stra += "版本: " + navigator.appVersion + "<br>";
stra += "启用Cookies: " + navigator.cookieEnabled + "<br>";
stra += "硬件平台: " + navigator.platform + "<br>";
stra += "用户代理: " + navigator.userAgent + "<br>";
stra += "用户代理语言: " + navigator.language + "<br><br>";
document.write(stra);
var strb = \'你的屏幕:\' + "<br>";
strb += "总宽度/高度: " + screen.width + "*" + screen.height + "<br>";
strb += "可视宽度/高度: " + screen.availWidth + "*" + screen.availHeight + "<br>";
strb += "颜色深度: " + screen.colorDepth + "<br>";
strb += "颜色分辨率: " + screen.pixelDepth + "<br><br>";
document.write(strb);
</script>
以上是关于获取手机尺寸的主要内容,如果未能解决你的问题,请参考以下文章
javascript中常见的函数封装 :判断是否是手机,判断是否是微信,获取url地址?后面的具体参数值,毫秒格式化时间,手机端pxrem尺寸转换等