Skip to content

Instantly share code, notes, and snippets.

View binnng's full-sized avatar
🎯
Focusing

binnng binnng

🎯
Focusing
View GitHub Profile
@binnng
binnng / gist:5372523
Last active December 16, 2015 03:49
Object.create创建对象, 疑惑的地方。具体看代码
var O = {a: 1};
var n = Object.create(O, {
a: {
value: 2
}
});
console.log(n); //{a: 1}
@binnng
binnng / gist:5378625
Last active December 16, 2015 04:39
bg.png和pic.png谁先加载?
<!doctype html>
<html>
<style type="text/css" rel="stylesheet">
#bg{background:url(bg.png)}
</style>
<div id="bg"></div>
<img src="pic.png" />
</html>
@binnng
binnng / gist:5393320
Last active December 16, 2015 06:39
多行文字居中显示
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<style>
.box{
width: 200px;
height: 200px;
background: #CCC;
display: table-cell;
@binnng
binnng / gist:5393529
Created April 16, 2013 05:12
display: run-in,追加到后一个block元素的里面
<!doctype html>
<html>
<style rel="stylesheet">
.inner{
height: 40px;
background-color: #f33;
}
.fir{
@binnng
binnng / gist:5394044
Created April 16, 2013 07:23
box-shadow VS dropshadow
<!doctype html>
<html>
<style rel="stylesheet">
div{
width: 60px;
height: 60px;
background: url(http://xnimg.cn/modules/global-publisher/res/tl-photo.png) center no-repeat;
}
.box_shadow{
@binnng
binnng / gist:5419053
Created April 19, 2013 08:54
消除iOS下type=submit的默认样式
-webkit-appearance: none;
@binnng
binnng / gist:5425922
Created April 20, 2013 13:10
#雅安加油!#表示哀悼,给网站置灰吧。
html {
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);
-webkit-filter: grayscale(100%);
}
@binnng
binnng / gist:5449490
Created April 24, 2013 03:53
属性是可以通过delete操作符删除的,而变量是不能的。
var c = 1;
delete c; //false
d = 1;
delete d; //true
window.e = 1;
delete e; //true
@binnng
binnng / gist:5458741
Created April 25, 2013 10:00
专门针对火狐的css hack
@-moz-document url-prefix(){
#feed_live .name{
position: relative;
top: 6px;
}
}
@binnng
binnng / gist:5458764
Created April 25, 2013 10:05
firefox 18.0.1 不支持window.id方式获取dom元素
<!doctype html>
<html>
<body>
<div id="nav"></div>
</body>
<script type="text/javascript">
alert(window.nav);
/**
* 经测试