This file contains 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
<style> | |
body { | |
margin: 100px; | |
} | |
.clipped { | |
position: relative; | |
width: 154px; | |
} |
This file contains 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
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="utf-8"> | |
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | |
<title>test</title> | |
<style> | |
body{ | |
margin:20px; | |
} | |
.element{ |
This file contains 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
/* 浏览器样式重置 | |
----------------------------------*/ | |
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,menu{ | |
margin:0; | |
padding:0; | |
} | |
article,aside,dialog,footer,header,section,footer,nav,figure,menu{ | |
display:block; | |
} | |
table{ |
This file contains 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
/** | |
part of html | |
<div id="box"> | |
<div id="preserve-box"> | |
<div class="front">我是正面</div> | |
<div class="bottom">我是反面</div> | |
</div> | |
</div> | |
**/ |
This file contains 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
/** | |
* 1. 清除浮动 | |
* 2. 固定Footer在页面底部的跨浏览器解决方案(2种方法实现) | |
* 3. css透明度opacity | |
* 4. @font-face语法 | |
* 5. 浏览器hack | |
* 6. PNG32透明(IE6) | |
* 7. 让IE9以下的版本支持HTML5 | |
* 8. 文本溢出省略 | |
* 9. 线性渐变(兼容) |
This file contains 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
/* | |
* 1. media query | |
* 2. meta标签 | |
* 3. link标签 | |
* 4. retina解决方案 | |
* 5. 判断手机或平板 | |
* 6. 关闭自动大写与自动修正 | |
* 7. 被点击元素外观变化,可以通过样式来设定 | |
* 8. 阻止旋转屏幕是自动调整字体大小 | |
**/ |
This file contains 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
/** | |
* ES5中新增数组方法的兼容实现 | |
* method:// forEach map filter some every indexof lastindexof reduce reduceRight | |
*/ | |
if(typeof Array.prototype.forEach != 'function'){ | |
Array.prototype.forEach = function(fn,context){ | |
if(typeof fn === 'function'){ | |
for(var i = 0,length = this.length; i<length; i++){ | |
fn.call(context,this[i],i,this); | |
} |
This file contains 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
var fs = require('fs'), | |
path = require('path'); | |
exports.merge = function(src,des,cb){ | |
if(!cb) cb = function(){} | |
var src = path.resolve(src), | |
des = path.resolve(des); | |
if(src.indexOf(des)){ | |
return cb(new Error('error')); |
This file contains 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($){ | |
$.GoToTop = { | |
defaults: { | |
autoShow : true, | |
timeEffect : 500, | |
effectScroll : 'linear', | |
appearMethod : 'slide' | |
}, | |
This file contains 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
module.exports = function (dest, src) { | |
Object.getOwnPropertyNames(src).forEach(function (name) { | |
var descriptor = Object.getOwnPropertyDescriptor(src, name) | |
Object.defineProperty(dest, name, descriptor) | |
}) | |
return dest | |
} | |
// called |
OlderNewer