摘要: // 工厂模式 function Person(name,age) { let o = new Object(); o.name = name; o.age = age; o.say = function() { console.log(this.name); } return o; //记得返回对 阅读全文
posted @ 2019-09-05 14:22 JSKevin 阅读(665) 评论(0) 推荐(0) 编辑
摘要: 1.引入第三个变量 2.splice方法, splice() 方法会直接对数组进行修改,splice() 方法向/从数组中添加/删除项目,然后返回被删除的项目。 3.数组解构赋值(数组长度大于2时不适用) 阅读全文
posted @ 2019-09-04 14:44 JSKevin 阅读(23459) 评论(2) 推荐(0) 编辑
摘要: 子组件获取父组件数据 运行结果: 父组件获取子组件数据 运行结果: 兄弟组件互传数据 运行结果: 未完,待续... 阅读全文
posted @ 2019-08-28 14:05 JSKevin 阅读(264) 评论(0) 推荐(0) 编辑
摘要: // 获取本年度第几周 var getYearWeek = function(a, b, c) { var date1 = new Date(a, parseInt(b) - 1, c), date2 = new Date(a, 0, 1), d = Math.round((date1.valueOf() - dat... 阅读全文
posted @ 2019-08-15 14:13 JSKevin 阅读(995) 评论(0) 推荐(0) 编辑
摘要: jQuery(document).delegate('input, textarea', 'blur', function(){ setTimeout(function(){ jQuery('html').animate({height: '100.1vh'}, 100, function(){ jQuery(this).animate({height: '100vh'}... 阅读全文
posted @ 2019-07-02 11:33 JSKevin 阅读(520) 评论(0) 推荐(0) 编辑
摘要: jq react scrollIntoView是一个与页面(容器)滚动相关的API 调用方法为 element.scrollIntoView() 参数默认为true。 参数为true时调用该函数,页面(或容器)发生滚动,使element的顶部与视图(容器)顶部对齐; 参数为false时,使eleme 阅读全文
posted @ 2019-06-03 11:40 JSKevin 阅读(688) 评论(0) 推荐(0) 编辑
摘要: 先看点击图片后的效果,可以左右滑动,放大缩小 html 调用方式 以下是fly-zomm-img.js,做了一些修改,也为了看到这篇文章的人方便做一些修改,所以不放压缩后的代码 阅读全文
posted @ 2019-05-08 17:40 JSKevin 阅读(1926) 评论(3) 推荐(0) 编辑
摘要: 只需在视频链接后面接上?rel=0&autoplay=1 阅读全文
posted @ 2019-05-07 10:09 JSKevin 阅读(12003) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-05-06 17:24 JSKevin 阅读(2321) 评论(0) 推荐(0) 编辑
摘要: 1.slice(数组) 用法:array.slice(start,end) 解释:该方法是对数组进行部分截取,并返回一个数组副本,不改变原数组;参数start是截取的开始数组索引,end参数等于你要取的最后一个字符的位置值加上1(可选) 2.slice(字符串) 用法:string.slice(st 阅读全文
posted @ 2019-05-05 15:38 JSKevin 阅读(356) 评论(0) 推荐(0) 编辑