IE低版本浏览器引导页

根据 appName 及 appVersion 判断IE版本
window.navigator.appName == “Microsoft Internet Explorer”
window.navigator.appVersion.split( “;” )[1].replace(/[ ]/g, “” ).replace( “MSIE” , “” )

IE9及以下版本显示引导页,封装插件源码

/**
 *  window.navigator.appName 
 *  IE9及以下版本 显示引导页面
 *  author jzt 2022-08-29
*/
;(function() {
    window.IEVersion = window.navigator.appName ==  "Microsoft Internet Explorer" && parseInt(window.navigator.appVersion.split( ";" )[1].replace(/[ ]/g,  "" ).replace( "MSIE" , "" )) < 10;
    var ieHtml = '<div class="IEVersion" id="IEVersion">\
    <div class="shadow"></div><div class="msg"><p class="t1">悲催,无法支持当前浏览器访问</p><p class="t2">建议更换成以下浏览器后重新访问</p><div class="zl clear"><div class="item"><a class="text"href="https://browser.qq.com/"target="_blank"><img class="icont"src="//cdn.51img3.com/game/2022/202203/20220318/ed02390ac08779d1896e3aae6da3dd92.png"alt="QQ浏览器"><p>QQ浏览器</p></a></div><div class="item"><a class="text"href="https://www.microsoft.com/zh-cn/edge/"target="_blank"><img class="icont"src="//cdn.51img3.com/game/2022/202203/20220318/4425a2b6788312fd2276d6252bd78f54.png"alt="Edge"><p>Edge</p></a></div><div class="item"><a class="text"href="https://www.google.cn/intl/zh-CN/chrome/"target="_blank"><img class="icont"src="//cdn.51img3.com/game/2022/202203/20220318/95bad6c149dc3125abb5e1a75a81df04.png"alt="Chrome"><p>Chrome</p></a></div></div></div>\
    <style>#IEVersion{width:100%;height:100%;left:0;top:0;position:fixed;z-index:99}#IEVersion .shadow{width:100%;height:100%;position:fixed;top:0;left:0;z-index:20;background:#f3f0f7}#IEVersion .msg{width:500px;position:absolute;top:50%;left:50%;margin-top:-175px;margin-left:-250px;z-index:25;background:transparent;text-align:center;font-style:18px}#IEVersion .msg .t1{font-size:18px;color:#3c3c3c;font-weight:400}#IEVersion .msg .t2{color:#757575;margin-top:5px;font-size:14px}#IEVersion .msg .zl{width:300px;margin:0 auto;margin-top:30px}#IEVersion .msg .zl .item{margin:0 10px;float:left;width:80px;text-align:center}#IEVersion .msg .zl .item .icont{width:48px;height:48px;display:block;margin:0 auto 10px}#IEVersion .msg .zl .item .text{font-size:12px;color:#4cbeff}</style></div>';
    if(IEVersion) { $("body").append(ieHtml); }
})();
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值