This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.all-IE{property:value\9;} | |
:root .IE-9{property:value\0/;} | |
.gte-IE-8{property:value\0;} | |
.lte-IE-7{*property:value;} | |
.IE-7{+property:value;} | |
.IE-6{_property:value;} | |
.not-IE{property//:value;} | |
@-moz-document url-prefix() { .firefox{property:value;} } | |
@media all and (-webkit-min-device-pixel-ratio:0) { .webkit{property:value;} } | |
@media all and (-webkit-min-device-pixel-ratio:10000),not all and (-webkit-min-device-pixel-ratio:0) { .opera{property:value;} } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 清除浮动 */ | |
.fix:after { | |
visibility:hidden; | |
display:block; | |
font-size:0; | |
content:" "; | |
clear:both; | |
height:0; | |
} | |
.clearfix { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="goods_pic img_vh_box"> | |
<span class="inner"> | |
<a href="#"> | |
<img src="http://ppms.paipaioa.com/img/demo/60x60.png" alt=""></a> | |
</span> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
background: -moz-linear-gradient(top, #FEFEFE 1%, #F1F1F3 100%); /* FF3.6+ */ | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#FEFEFE), color-stop(100%,#F1F1F3)); /* Chrome,Safari4+ */ | |
background: -webkit-linear-gradient(top, #FEFEFE 1%,#F1F1F3 100%); /* Chrome10+,Safari5.1+ */ | |
background: -o-linear-gradient(top, #FEFEFE 1%,#F1F1F3 100%); /* Opera11.10+ */ | |
background: -ms-linear-gradient(top, #FEFEFE 1%,#F1F1F3 100%); /* IE10+ */ | |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FEFEFE', endColorstr='#F1F1F3',GradientType=0 ); /* IE6-9 */ | |
background: linear-gradient(top, #FEFEFE 1%,#F1F1F3 100%); /* W3C */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 缓存 | |
for(var i=0, j = document.getElementsByTagName('a').length; i0; i--){ | |
} | |
// 据说是最快的 | |
while(i--){ | |
// maybe fastest | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 使用事件代理,在更外层的元素上监听事件 | |
document.getElementById('list').onclick = function(evt){ | |
var evt = evt || window.event, | |
target = evt.target || evt.srcElement; | |
if(target.id === 'btn1'){ | |
// do something | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 尽量使用,可以传入多个参数,最后输出拼接后的字符串 | |
console.log('xx','xx','...'); | |
console.dir(someObj); | |
console.dirxml(someDom); | |
console.time('timer'); | |
console.warn('xxx'); | |
// 封装可以保证不小心发布出去也不会导致问题,但报错时行号可能有问题 | |
function msg(msg){ | |
if(console && console.log){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-webkit-text-size-adjust:none;} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 简写:单个属性:*/ | |
-moz-transition:background 0.5s ease-out 0s; | |
/* 简写:多个属性:*/ | |
-moz-transition:background, 0.5s ease-out 0s, color 0.4 ease-out 0s; | |
/* 过渡单个 */ | |
{ | |
transition-property:opacity; | |
transition-duration:2s; | |
transition-timing-function:ease-in; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasClass(el, name) { | |
return new RegExp('(\\s|^)'+name+'(\\s|$)').test(el.className); | |
} | |
function addClass(el, name) | |
{ | |
if (!hasClass(el, name)) { el.className += (el.className ? ' ' : '') +name; } | |
} | |
function removeClass(el, name) | |
{ |
OlderNewer