/**
*检查浏览器
* @returns {boolean}
*/
function getExplorerInfo() {
var explorer = window.navigator.userAgent.toLowerCase();
if (explorer.indexOf("msie") >= 0) {
if (explorer.indexOf("msie 6.0") > 0 || explorer.indexOf("msie 7.0") > 0 || explorer.indexOf("msie 8.0") > 0 && !window.innerWidth) {
$(".install-tips").show();
return true;
}
}
$(".install-tips").hide();
return false;
}
<div class="install-tips"
style="display: none; position: absolute; width: 100%; height: 100%; overflow: hidden;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#60ffffff,endColorstr=#60ffffff);">
<div style="line-height: 28px; height: 120px; width: 400px; position: absolute; top: 50%; left: 50%; margin-left: -150px; margin-top: -60px; font-size: 16px; background: #468eca; color: #fff; padding: 30px;">
<p>1.当前浏览器版本太低或已开启兼容模式,使用可能会有问题</p>
<p>2.请安装IE9及以上版本并且取消兼容模式</p>
<p>3.或者 <a href='help/ChromeStandalone_59.0.3071.86_Setup.exe' style="color: red;">下载</a> 安装最新版Chrome浏览器</p>
</div>
</div>
$(document).ready(function () {
getExplorerInfo();
});
前端检查浏览器版本
最新推荐文章于 2024-06-30 21:55:10 发布