初始化项目
This commit is contained in:
BIN
public/util/screen/guge.png
Normal file
BIN
public/util/screen/guge.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
BIN
public/util/screen/huohu.png
Normal file
BIN
public/util/screen/huohu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 421 KiB |
32
public/util/screen/screen.css
Normal file
32
public/util/screen/screen.css
Normal file
@@ -0,0 +1,32 @@
|
||||
.el-tip {
|
||||
position: fixed;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 500px;
|
||||
padding: 8px 16px;
|
||||
margin: 0;
|
||||
margin-left: -250px;
|
||||
margin-top: -60px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 4px;
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
opacity: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
transition: opacity .2s;
|
||||
}
|
||||
|
||||
.el-tip--warning {
|
||||
background-color: #fdf6ec;
|
||||
color: #e6a23c;
|
||||
}
|
||||
|
||||
.el-tip__title {
|
||||
line-height: 18px;
|
||||
}
|
||||
.el-tip_img img{
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
47
public/util/screen/screen.js
Normal file
47
public/util/screen/screen.js
Normal file
@@ -0,0 +1,47 @@
|
||||
function util() {
|
||||
this.flag = true;
|
||||
var body = document.body;
|
||||
var safe = this;
|
||||
var validVersion = function() {
|
||||
var browser = navigator.appName
|
||||
var b_version = navigator.appVersion
|
||||
var version = b_version.split(";");
|
||||
var trim_Version = version[1].replace(/[ ]/g, "");
|
||||
if (trim_Version == 'WOW64') {
|
||||
safe.flag = false
|
||||
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE6.0") {
|
||||
safe.flag = false
|
||||
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE7.0") {
|
||||
safe.flag = false
|
||||
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE8.0") {
|
||||
safe.flag = false
|
||||
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE9.0") {
|
||||
safe.flag = false
|
||||
}
|
||||
}
|
||||
this.setBody = function() {
|
||||
var str = '<div class="el-tip el-tip--warning" id="tip">' +
|
||||
'<div class="el-tip_content">' +
|
||||
'<span class="el-tip__title">' +
|
||||
'您乘坐的浏览器版本太低了,你可以把浏览器从兼容模式调到极速模式' +
|
||||
'<br /> 实在不行就换浏览器吧;' +
|
||||
'</span>' +
|
||||
'<div class="el-tip_img">' +
|
||||
'<img src="/manage/util/screen/huohu.png" alt="">' +
|
||||
'<img src="/manage/util/screen/guge.png" alt="">' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
body.innerHTML = str + body.innerHTML
|
||||
}
|
||||
this.init = function() {
|
||||
validVersion(); //检测浏览器的版本
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
var creen = new util().init();
|
||||
var flag = creen.flag;
|
||||
if (!flag) {
|
||||
creen.setBody();
|
||||
}
|
||||
Reference in New Issue
Block a user