Skip to content

Commit

Permalink
添加样式
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 18, 2015
1 parent 586d904 commit 2cd3f47
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 28 deletions.
37 changes: 30 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
#升级浏览器
# 升级浏览器


## 兼容浏览器

IE 6+, Chrome, Firefox ...

## 调用方法
`outdatedbrowser` 不传参数默认使用已定义好的

```js
window.outdatedbrowser({
"firefox":{
"url":"http://baidu.com"
}
window.onload = function (argument) {
window.outdatedbrowser()
};
```



})
```

## 不使用默认数据

```js
window.onload = function (argument) {
window.outdatedbrowser({
"chrome":{
"url":"http://www.google.com/chrome",
// "available":["windows","mac","linux"],
"title":"GOOGLE CHROMSSSSSE"
},
"firefox":{
"url":"http://www.mozilla.org/firefox/new/",
"available":["windows","mac","linux"],
"title":"Mozilla Firefox"
}
})
};
```
2 changes: 1 addition & 1 deletion lib/outdatedbrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
},
imgURL='browsers-bg.png',
style = 'body,html,.outdatedbrowser i.icon{margin:0;padding:0}body,html{height:100%;}.outdatedbrowser{position:absolute;top:0;left:0;height:100%;width:100%;z-index:999;overflow:auto;text-align:center;}.outdatedbrowser a{border:1px solid #fff}.outdatedbrowser .browser{text-decoration:blink;padding:30px 0 30px 0;display:inline-block;width:230px;overflow:hidden;vertical-align:middle;background:#e6e6e6;margin:0 5px 0 5px}.outdatedbrowser .btn{padding:7px 19px;border-radius:5px;background:#007a09;color:#fff}.outdatedbrowser h2,.outdatedbrowser h4,.outdatedbrowser p{display:block;color:#333;font-size:18px;$block}.outdatedbrowser p span{font-size:12px;padding:0 5px 0 5px}.outdatedbrowser h1{position:absolute;display:block;width:100%;padding-top:20px;color:#046d00}.outdatedbrowser .split{display:inline-block;height:100%;vertical-align:middle}.outdatedbrowser i.icon{display:block;position:relative;width:89px;height:89px;margin:0 auto 35px;background:transparent url("'+imgURL+'") no-repeat}.outdatedbrowser a:hover .btn{text-decoration:underline}.outdatedbrowser .chrome i.icon{background-position:-6px -6px}.outdatedbrowser .firefox i.icon{background-position:-105px -6px}.outdatedbrowser .internetExplorer i.icon{background-position:-206px -6px}.outdatedbrowser .safari i.icon{background-position:-306px -6px}.outdatedbrowser .opera i.icon{background-position:-406px -6px}.outdatedbrowser .chrome:hover i.icon{background-position:-6px -108px}.outdatedbrowser .firefox:hover i.icon{background-position:-105px -108px}.outdatedbrowser .internetExplorer:hover i.icon{background-position:-206px -108px}.outdatedbrowser .safari:hover i.icon{background-position:-306px -108px}.outdatedbrowser .opera:hover i.icon{background-position:-406px -108px}';
style = 'body,html,.outdatedbrowser h2,.outdatedbrowser h4,.outdatedbrowser p,.outdatedbrowser i.icon{margin:0;padding:0}body,html{height:100%;}.outdatedbrowser{position:absolute;top:0;left:0;height:100%;width:100%;z-index:999;overflow:auto;text-align:center;background:#fff;}.outdatedbrowser a{border:1px solid #fff}.outdatedbrowser .browser{text-decoration:blink;padding:30px 0 30px 0;display:inline-block;width:230px;overflow:hidden;vertical-align:middle;background:#e6e6e6;margin:0 5px 0 5px}.outdatedbrowser .btn{padding:7px 19px;border-radius:5px;background:#007a09;color:#fff}.outdatedbrowser h2,.outdatedbrowser h4,.outdatedbrowser p{display:block;color:#333;font-size:18px}.outdatedbrowser span{display:inline-block;margin:20px 0}.outdatedbrowser p span{font-size:12px;padding:0 5px 0 5px}.outdatedbrowser h1{position:absolute;display:block;width:100%;padding-top:20px;left:0;top:0;color:#046d00}.outdatedbrowser .split{display:inline-block;height:100%;vertical-align:middle}.outdatedbrowser i.icon{display:block;position:relative;width:89px;height:89px;margin:0 auto 35px;background:transparent url("'+imgURL+'") no-repeat}.outdatedbrowser a:hover .btn{text-decoration:underline}.outdatedbrowser .chrome i.icon{background-position:-6px -6px}.outdatedbrowser .firefox i.icon{background-position:-105px -6px}.outdatedbrowser .internetExplorer i.icon{background-position:-206px -6px}.outdatedbrowser .safari i.icon{background-position:-306px -6px}.outdatedbrowser .opera i.icon{background-position:-406px -6px}.outdatedbrowser .chrome:hover i.icon{background-position:-6px -108px}.outdatedbrowser .firefox:hover i.icon{background-position:-105px -108px}.outdatedbrowser .internetExplorer:hover i.icon{background-position:-206px -108px}.outdatedbrowser .safari:hover i.icon{background-position:-306px -108px}.outdatedbrowser .opera:hover i.icon{background-position:-406px -108px}'

window.outdatedbrowser=function(json){
this.container = document.createElement('div'),
Expand Down
6 changes: 5 additions & 1 deletion lib/outdatedbrowser.styl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ body,html
z-index: 999
overflow: auto
text-align: center
background: #FFF
a
border:1px solid #fff
.browser
Expand All @@ -31,10 +32,13 @@ body,html
background: #007A09;
color: #fff;
h2,h4,p
@extend $block
display:block
color:#333
font-size:18px
$block
span
display: inline-block;
margin:20px 0
p
span
font-size:12px
Expand Down
38 changes: 20 additions & 18 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,29 @@
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>过时的浏览器</title>
<script type="text/javascript" src="../lib/outdatedbrowser.js"></script>
<link rel="stylesheet" type="text/css" href="outdatedbrowser.css">
</head>
<body>
<script type="text/javascript">
// outdatedbrowser()


window.outdatedbrowser({
"chrome":{
"url":"http://www.google.com/chrome",
// "available":["windows","mac","linux"],
"title":"GOOGLE CHROMSSSSSE"
},
"firefox":{
"url":"http://www.mozilla.org/firefox/new/",
"available":["windows","mac","linux"],
"title":"Mozilla Firefox"
}
})
</script>

asdfasdfsdf
<!-- <div class="outdatedbrowser">
<h1>请更新浏览器</h1>
<span class="split"></span>
Expand Down Expand Up @@ -36,23 +56,5 @@ <h4>在以下操作系统可用 </h4>
<p><span class="windows">Windows</span><span class="windows">Mac OS</span><span class="windows">Linux</span></p>
</a>
</div> -->
<script type="text/javascript" src="../lib/outdatedbrowser.js"></script>
<script type="text/javascript">
// outdatedbrowser()


window.outdatedbrowser({
"chrome":{
"url":"http://www.google.com/chrome",
// "available":["windows","mac","linux"],
"title":"GOOGLE CHROMSSSSSE"
},
"firefox":{
"url":"http://www.mozilla.org/firefox/new/",
"available":["windows","mac","linux"],
"title":"Mozilla Firefox"
}
})
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion test/outdatedbrowser.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2cd3f47

Please sign in to comment.