
原生javascript
vcxiaohan2
这个作者很懒,什么都没留下…
展开
-
完美运动框架
function startMove(obj, json, fnEnd) //换为json,如:startMove(oDiv, {width: 400, height: 400}) { clearInterval(obj.timer); obj.timer = setInterval(function() { var bStop =原创 2015-11-24 17:49:40 · 407 阅读 · 0 评论 -
js选择器封装
原文链接:http://www.tuicool.com/articles/ieI7fufunction Jr() {}Jr.prototype.getId = function(id) { return document.getElementById(id);}//获取CLASS节点数组Jr.prototype.getClass = function(className,原创 2016-05-19 16:20:30 · 1800 阅读 · 0 评论 -
querySelector和css3选择器
querySelector:http://www.nowamagic.net/librarys/veda/detail/388css3:http://www.w3school.com.cn/cssref/css_selectors.asp test * {margin: 0; padding: 0;} body {原创 2016-06-21 14:17:59 · 2817 阅读 · 0 评论 -
js自定义事件
test * { margin: 0; padding: 0; font-size: 0.04rem; } body, html { width: 100%; height: 100%; }原创 2016-08-10 23:17:21 · 315 阅读 · 0 评论 -
原生js写的简单心电图
svg body, html { width: 100%; height: 100%; font-size: 0; background: #000; } .circle { background: #fff;原创 2016-07-21 00:53:51 · 6465 阅读 · 1 评论 -
js原生实现jquery方法offset()和position()
$(() => { console.log($('p').offset()) console.log($('p').position()) console.log(offset($('p')[0])) console.log(position($('p')[0])) // jquery offset原生实现 function offset(target)原创 2017-08-19 09:45:27 · 5097 阅读 · 0 评论 -
js自定义事件
自定义事件(简单版)let Event = { /* 绑定事件 Event.on('log', function(param1, param2) {// 绑定一个log事件,并接收param1和param2参数 console.log(1, param1, param2) }) */ on(event, cb) { if原创 2018-03-01 15:56:28 · 690 阅读 · 1 评论 -
js函数柯里化的理解
对象扁平化应用场景node接收参数时,无法自动转换参数,如:’false’不能转为false原创 2018-07-25 15:13:10 · 3263 阅读 · 0 评论