Skip to content

Instantly share code, notes, and snippets.

View zhoufenfens's full-sized avatar
:bowtie:
i am working

zhou zhoufenfens

:bowtie:
i am working
View GitHub Profile
function Polygon(sides){
this.sides = sides;
this.setSides = function(s) {this.sides=s;}
};
function Tri(sides){
Polygon.apply(this,[sides]);
}
var tri=new Tri(4);
console.log(tri.sides);
七月十二号交了2700的房钱,三个月
@zhoufenfens
zhoufenfens / prototype
Created July 18, 2013 01:38
prototype
参考资料:
http://dmitrysoshnikov.com/ecmascript/javascript-the-core/
http://www.quora.com/JavaScript/What-is-the-difference-between-__proto__-and-prototype?q=javascript+__proto__+prototype
笔记:
(1)
/**
* Created with JetBrains WebStorm.
* User: mobin
* Date: 13-7-16
* Time: 下午3:28
* To change this template use File | Settings | File Templates.
*/
$(document).ready(function(){
(function(exports){
foo = function() {
this.myName = "Foo function.";
}
foo.prototype.sayHello = function() {
alert(this.myName);
}
foo.prototype.bar = function() {
setTimeout(this.sayHello.call(this), 1000);
}
var f = new foo();
@zhoufenfens
zhoufenfens / style.css
Last active December 20, 2015 03:59
gradient effect
ul#position li.on{
box-shadow: inset 0 1px 3px -1px #28b4ea,0 1px 2px rgba(0,0,0,.5);
background-color: #1293dc;
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#1293dc),color-stop(100%,#0f6297));
background-image: -webkit-linear-gradient(top,#1293dc,#0f6297);
background-image: linear-gradient(top,#1293dc,#0f6297);
}
function throttle( fn, time ) {
var t = 0;
return function() {
var args = arguments, ctx = this;
clearTimeout(t);
t = setTimeout( function() {
fn.apply( ctx, args );
}, time );
};
@zhoufenfens
zhoufenfens / fileuploader
Created August 13, 2013 07:43
file uploader
function changehandler(){
console.log("change");
var file = document.getElementById('fileupload').files[0];
var reader=new FileReader();
reader.onload = (function(theFile) {
return function(e) {
console.log(e.target.result);
// img 元素
@zhoufenfens
zhoufenfens / 1
Created August 15, 2013 12:31
借钱
8月13号借给老査500元
@zhoufenfens
zhoufenfens / 2
Created August 15, 2013 12:32
8.15
8.15垫付50块保洁费