摘要: //定义函数 获取对象的构造函数(类)名 function getObjectClass(obj) { return Object.prototype.toString.call(obj).slice(8, -1) } function deepClone(obj) { if (getObjectC 阅读全文
posted @ 2019-12-14 09:59 詹姆斯小皇帝 阅读(172) 评论(0) 推荐(0) 编辑
摘要: const fs = require('fs'); const promise = new Promise((resolve, reject) => { fs.open('./c.txt', 'w', (err, fd) => { if (!err) { resolve(fd); }else { r 阅读全文
posted @ 2019-12-14 09:57 詹姆斯小皇帝 阅读(446) 评论(0) 推荐(0) 编辑
摘要: Function.prototype.call2 = function (context, ...args) { var context = context || window; //改变this指向 context.__proto__.fn = this; //调用函数 var res = con 阅读全文
posted @ 2019-12-14 09:55 詹姆斯小皇帝 阅读(532) 评论(0) 推荐(0) 编辑
摘要: <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,viewport-fit:cover"> 阅读全文
posted @ 2019-12-03 18:17 詹姆斯小皇帝 阅读(116) 评论(0) 推荐(0) 编辑
摘要: tween算法 https://www.cnblogs.com/cloudgamer/archive/2009/01/06/Tween.html 参数说明: t: current time:当前时间; b: beginning value:初始值,元素的初始位置; c: change in valu 阅读全文
posted @ 2019-12-03 16:38 詹姆斯小皇帝 阅读(302) 评论(0) 推荐(0) 编辑
摘要: // 绑定滚轮事件//chrome iedocument.addEventListener('mousewheel', scrollMove);//firefoxdocument.addEventListener('DOMMouseScroll', scrollMove);/** 实现滚轮滚动触发的 阅读全文
posted @ 2019-12-03 16:22 詹姆斯小皇帝 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 节流 throttle 节流(throttle):当持续触发事件时,保证一定时间段内只调用一次事件处理函数。 函数节流主要有两种实现方法:时间戳和定时器。 var throttle = function(func, delay) { var prev = Date.now(); return fun 阅读全文
posted @ 2019-12-03 16:17 詹姆斯小皇帝 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 实现全屏 个人版:function isFullScreen() { var fullscreenElement = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenEle 阅读全文
posted @ 2019-12-03 13:06 詹姆斯小皇帝 阅读(1166) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, 阅读全文
posted @ 2019-12-02 08:33 詹姆斯小皇帝 阅读(135) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-12-01 16:46 詹姆斯小皇帝 阅读(1) 评论(0) 推荐(0) 编辑