现在的位置: 首页 > 综合 > 正文

评估浏览器级别,提醒升级

2013年05月02日 ⁄ 综合 ⁄ 共 6344字 ⁄ 字号 评论关闭

是时候拒绝一些老旧的浏览器了,诱导你的用户升级浏览器吧  = =!

 

这张网页以IE 各本版本为参照粗略地评估访客的浏览器等级,提醒低于IE8 级别(没办法,XP不支持IE9)的浏览器用户更换浏览器。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="Edge" />
<!--
<meta http-equiv="X-UA-Compatible" content="IE6" />
-->

<!-- 哆啦A梦 css, from internet -->
<link rel="stylesheet" href="http://files.cnblogs.com/ecalf/duolaAmeng.css" />
</head>
<body>

<style>
.nomoreie
{
width
:550px;
display:none;
clear
: both;
position
: relative;
left
:-260px;
margin-left
:50%;
margin-top
:50px;
border
: 1px solid #F7941D;
background
: #FEEFDA;
text-align
: center;
}
.nomoreie img
{
border
:none;
}

.nomoreie .close{
position
: absolute;
right
: 3px;
top
: 3px;
border
:none;
width
:24px;
cursor
:pointer;
}

.nomoreie .notice{
width
:530px;
margin
: 0 auto;
text-align
: left;
padding
: 0;
color
: black;
overflow
: hidden;
display
:inline-block;
*display
:inline;
*zoom
:1;
}

.nomoreie .warning-icon{
float
: left;
vertical-align
: middle;
}

.nomoreie .warning-text{
float
: left;
width
: 275px;
height
: 96px;
}
.nomoreie .infor
{
font-size
: 14px;
font-weight
: bold;
margin-top
: 12px;
}
.nomoreie .infor2
{
font-size
: 14px;
font-weight
: bold;
margin-bottom
: 12px;
}

.nomoreie .tip{
font-size
: 12px;
margin-top
: 6px;
margin-bottom
: 6px;
margin-left
: 6px;
line-height
: 12px;
}

.nomoreie .dlam{
float
:left;
overflow
: hidden;
text-align
: center;
height
: 96px;
cursor
: pointer;
}

.nomoreie .dlam img{
margin-left
:5px;
margin-top
:4px;
}

.nomoreie .dlam p{
font-size
: 12px;
margin-top
: 4px;
line-height
: 12px;
font-weight
: bold;
}

.nomoreie .browsers{
position
: relative;
overflow
: hidden;
width
:530px;
margin
:0 auto;
display
:inline-block;
*display
:inline;
*zoom
:1;
}

.nomoreie .browsers div{
width
: 75px;
float
: left;
}

.nomoreie .browsers p{
font-size
: 14px;
font-weight
: bold;
height
:25px;
line-height
: 20px;
margin
:0;
}

.nomoreie .browserTestInfo{
width
:530px;
margin
:10px;
border-top
: 1px dashed #454545;
}

.nomoreie .browserTestInfo p{
text-align
: left;
font-size
: 12px;
font-family
: Arial, sans-serif;
margin
:0px;
margin-top
:10px;
}

</style>

<div id="browserRefuse" class="nomoreie">
<img src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_close.png" class="close" onclick="javascript:this.parentNode.style.display='none';" alt="Close this notice" />

<div class="notice">
<a href="http://www.ie6nomore.com/">
<img class="warning-icon" src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_warning.png" alt="Warning!">
</a>
<div class="warning-text">
<div class="infor">
You are using an outdated browser
</div>
<div class="tip">
For a better experience using this site, please upgrade to a modern web browser.
</div>
<div class="infor2">
你的浏览器版本太旧,点击下载最新版本
</div>
</div>
<div id="gotestDLAM" class="dlam">
<img height="56" src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_dlam.png" />
<img height="56" src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_dlamIE8.png" />
<p>多啦A梦帮你测试浏览器</p>
</div>
</div>

<div class="browsers">
<div>
<a href="http://www.firefox.com" target="_blank">
<img src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_firefox.png" style="border: none;" alt="Get Firefox">
</a>
<p>Firefox</p>
</div>

<div>
<a href="http://www.google.com/intl/zh-CN/chrome/browser/" target="_blank">
<img src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_chrome.png" style="border: none;" alt="Get Google Chrome">
</a>
<p>Chrome</p>
</div>

<div>
<a href="http://www.opera.com/" target="_blank">
<img src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_opera.png" style="border: none;" alt="Get Opera">
</a>
<p>Opera</p>
</div>

<div>
<a href="http://support.apple.com/kb/HT4612" target="_blank">
<img src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_safari.png" style="border: none;" alt="Get Safari">
</a>
<p>Safari</p>
</div>

<div>
<a href="http://windows.microsoft.com/zh-cn/internet-explorer/downloads/ie-10/worldwide-languages" target="_blank">
<img src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_ie10.png" style="border: none;" alt="Get Internet Explorer 10">
</a>
<p>IE10</p>
</div>

<div>
<a href="http://windows.microsoft.com/zh-cn/internet-explorer/downloads/ie-9/worldwide-languages" target="_blank">
<img src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_ie9.png" style="border: none;" alt="Get Internet Explorer 9">
</a>
<p>IE9</p>
</div>

<div>
<a href="http://www.microsoft.com/zh-cn/download/details.aspx?id=43" target="_blank">
<img src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_ie8.png" style="border: none;" alt="Get Internet Explorer 8">
</a>
<p>IE8</p>
</div>
</div>
<div id="showTest" class="browserTestInfo"></div>
</div>

<!-- 多啦A梦-->
<div id="dlamHolder">
<div id="doraemon">
<div id="face">
<div id="head_light"></div>
<div id="eyes">
<div class="eye eye_left"></div>
<div class="black_eye black_left"></div>
<div class="eye eye_right"></div>
<div class="black_eye black_right"></div>
</div>
<div id="base">
<div id="base_white"></div>
<div id="nose">
<div id="nose_light"></div>
</div>
<div id="jason5ng32-nose_line"></div>
<div id="mouth"></div>
<div id="mouth_rewrite"></div>
<div id="firefox_mouth"></div>
<div class="whiskers whi_right_top rotate160"></div>
<div class="whiskers whi_right"></div>
<div class="whiskers whi_right_bottom rotate20"></div>
<div class="whiskers whi_left_top rotate20"></div>
<div class="whiskers whi_left"></div>
<div class="whiskers whi_left_bottom rotate160"></div>
</div>
</div>

<div id="jason5ng32-choker">
<div id="belt"></div>
<div id="jason5ng32-bell">
<div id="jason5ng32-bell_line"></div>
<div id="jason5ng32-bell_circle"></div>
<div id="jason5ng32-bell_under"></div>
<div id="jason5ng32-bell_light"></div>
</div>
</div>

<div id="body">
<div id="doutai"></div>
<div class="base_white2 doutai_center"></div>
<div id="pocket">
<div id="circle"></div>
<div id="circle_rewrite"></div>
</div>
</div>

<div id="hand_right">
<div id="arm_right"></div>
<div class="hand_circle hand_right"></div>
<div class="arm_rewrite_right"></div>
</div>
<div id="hand_left">
<div id="arm_left"></div>
<div class="hand_circle hand_left"></div>
<div class="arm_rewrite_left"></div>
</div>

<div id="foot">
<div id="foot_left"></div>
<div id="foot_right"></div>
<div id="foot_rewrite"></div>
</div>

<div id="shadow_doutai_arm"></div>
<div id="shadow_doutai_left"></div>
<div id="shadow_doutai_right"></div>
<div id="shadow_belt"></div>
</div>

<div id="dlamCompare">
<img src="http://images.cnblogs.com/cnblogs_com/ecalf/449311/o_dlam.png" />
</div>
<div id="dlamText">
<p>
如果你的浏览器支持最新的网页制作技术,你将在左侧看到与右图一样的多啦A梦,还不时地转着眼珠.
</p>
<p>
推荐使用最新版本的 chrome、firefox、opara、safari、ie9(vista 以上)、ie10(win7 以上) 浏览器.
</p>
<p id="backtobrowser">返回</p>
</div>
</div>

<script>

function browserLevelCheck(n){
//浏览器粗略分级,基于IE ,比较是否达到某个等级,或返回浏览器的等级
var rst,iframe,node,pNode;
n
= n*1||10000;
switch(n){
case 10000:
case 10:
iframe
= document.createElement("iframe

抱歉!评论已关闭.