自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

神百事的博客

初窥门径的前端er

  • 博客(5)
  • 收藏
  • 关注

原创 js的36个设计模式:技巧型模式

1.链模式通过return this,让函数对象可以链式调用。function fn(){ this.a = function(){ console.log("a"); return this; }; this.b = function(){ cosnole.log("b"); return this;

2017-04-21 13:29:59 477

原创 js的36个设计模式:行为型模式

1.模板方法模式不太好描述,就类似封装一个插件,传入不同参数和函数,实现添加dom的样式和方法。2.观察者模式跳过3.状态模式把多个判断封装到函数内。var a = "run"; function action(a){ if(a == "run"){ //code }else if(a == "jump"){ //code }else if(a

2017-04-21 13:29:19 910

原创 原生js实现复制浏览器内容

<!DOCTYPE html> <html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> </head><body> <div id="con">需要复制的文字</div> <br> <input type="button" name="" value="点击复制" onclic

2017-04-21 13:28:34 4857 2

原创 es2015

//1.let 只在作用域内有效 let name = "a";function fn() { let name = "b"; console.log(name); //b }fn(); console.log(name); //a//2.const 用来声明常量,一但声明就无法改变 const a = "a"; //a = "b"; console.log(a); //3.class 类

2017-04-21 13:23:53 393

原创 js实现lazyman(流程控制)

function _lazyMan(name) { this.name = name; this.task = []; this.default(); var _this = this; setTimeout(function() { _this.next(); }, 0) } _lazyMan.prototype.next = fun

2017-04-21 13:22:59 1167

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除