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 fun(n,o) { | |
console.log(o) | |
return { | |
fun:function(m){ | |
return fun(m,n); | |
} | |
}; | |
} | |
var a = fun(0); a.fun(1); a.fun(2); a.fun(3);//undefined,0 ,0 ,0 | |
var b = fun(0).fun(1).fun(2).fun(3);//undefined,0,1,2 |
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
@charset "utf-8"; | |
/* 清除内外边距 */ | |
body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, /* structural elements 结构元素 */ | |
dl, dt, dd, ul, ol, li, /* list elements 列表元素 */ | |
pre, /* text formatting elements 文本格式元素 */ | |
fieldset, legend, button, input, textarea, /* form elements 表单元素 */ | |
th, td { /* table elements 表格元素 */ | |
margin: 0; | |
padding: 0; |
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{*zoom:1;} | |
.fix:after{display:table; content:''; clear:both;} | |
/* 单行文字溢出虚点显示,前提是文本长度大于容器的宽度 */ | |
/*记忆要点元素溢出、文本溢出、不换行*/ | |
.ell{text-overflow:ellipsis; white-space: nowrap; overflow: hidden;} | |
/* 块状元素水平居中 */ | |
.auto{margin-left:auto; margin-right:auto;} | |
/* 基于display:table-cell的自适应布局 */ | |
.cell{display:table-cell; *display:inline-block; width:2000px; *width:auto;} |
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
var fun = function(){ | |
} | |
fun.prototype = { | |
info : { | |
name : 'peter', | |
age : 25 | |
} | |
} | |
var a = new fun(); |
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
// Zepto.js | |
// (c) 2010-2016 Thomas Fuchs | |
// Zepto.js may be freely distributed under the MIT license. | |
// Zepto 用CSS3动画实现动画 | |
;(function($, undefined){ | |
var prefix = '', eventPrefix, | |
vendors = { Webkit: 'webkit', Moz: '', O: 'o' }, | |
testEl = document.createElement('div'), | |
supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i, |
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
/** | |
* @param {Object} option | |
* @param {jQuery | String} option.defObj jQuery对象或作为选择器的字符串 | |
* @param {Number} opiton.defHeight 为负数时,则可以提前加载视口下方的图片资源 | |
*/ | |
function lazyload(option) { | |
var settings = { | |
// {jQuery | String} jQuery对象或作为选择器的字符串 | |
defObj: null, | |
// {Number} 为负数时,则可以提前加载视口下方的图片资源 |
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 sym() { | |
var ans = []; | |
var args = Array.prototype.slice.call(arguments); | |
var len = args.length; | |
var two; | |
function uniq(arr) { | |
var output = []; | |
var objMark = {}; | |
arr.forEach(function(item, index) { |
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
/* Based on Alex Arnell's inheritance implementation. */ | |
/** section: Language | |
* class Class | |
* | |
* Manages Prototype's class-based OOP system. | |
* | |
* Refer to Prototype's web site for a [tutorial on classes and | |
* inheritance](http://prototypejs.org/learn/class-inheritance). | |
**/ |
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
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video { | |
margin: 0; | |
padding: 0; | |
border: 0; | |
font-size: 100%; | |
font: inherit; | |
vertical-align: baseline | |
} | |
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section { |