自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 防抖与节流概念

防抖与节流//防抖<body> <input type="text" id="inp"> <script> var oInp = document.getElementById('inp'); function ajax(e) { console.log(e, this.value); } function debounce(handler, delay) {

2021-08-07 16:28:20 96

原创 数组去重方法

// 数组去重Array.prototype.unique = function(){ var temp = {}; var arr = []; var len = this.length; for(var i = 0; i < len; i++){ if(!temp[this[i]]){ temp[this[i]] = 'abc'

2021-08-05 15:56:25 101

原创 js深度克隆

// 深度克隆 // 深度克隆 function deepClone(target,origin){ var target = target || {}, toStr = Obejct.prototype.toString, arrStr = '[object Array]'; for(var prop in origin){ if(origin.

2021-08-05 13:36:21 87

原创 js圣杯模式

// 圣杯模式var inherit = function(){ var F = function(){}; return function(target,origin){ F.prototype = origin.prototype; target.prototype = new F(); target.prototype.constructor = target; target.prototype.uber = origin.prototype;}

2021-08-05 13:28:48 249

原创 move运动函数

//封装一个运动函数// Move function getStyle(ele, attr) { if (window.getComputedStyle) { return window.getComputedStyle(ele, null)[attr]; } else { return ele.currentStyle[attr]; } } function startMove(dom, attrObj, callback) {

2021-08-05 13:18:45 221

原创 bind方法源码

//bind封装源码Function.prototype.newBind = function (target) { target = target || window; var self = this; var args = [].slice.call(arguments, 1); var temp = function () {}; var F = function () { var _arg = [].slice.call(arguments,

2021-08-05 13:16:51 283

原创 封装cookie方法

封装一个cookie方法var myCookie = { // 设置cookie set: function (name, value, date) { // max-age 要求用户传入的是过期的秒数 document.cookie = name + '=' + value + '; max-age=' + date }, // 移除cookie remove: function (name) {

2021-08-05 13:12:32 139

原创 drag方法——>拖拽

drag方法 拖拽 var drag = { init: function (dom) { this.dom = dom; this.bindEvent(); }, bindEvent: function () { this.dom.onmousedown = this.mouseDown.bind(this); }, mouseDown: function (e) { docume

2021-08-05 13:01:33 384

空空如也

空空如也

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

TA关注的人

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