随笔分类 -  js

摘要:调用 阅读全文
posted @ 2018-12-07 15:28 abcByme 阅读(444) 评论(0) 推荐(0)
摘要:引入video.css 和video.js 为前提 调用主要是 阅读全文
posted @ 2018-11-27 13:05 abcByme 阅读(6943) 评论(0) 推荐(0)
摘要:QQ音乐接口播放经常换, 最开始 url: `http://ws.stream.qqmusic.qq.com/${musicData.songid}.m4a?fromtag=46` 然后 url:`http://ws.stream.qqmusic.qq.com/C100${musicData.son 阅读全文
posted @ 2018-11-20 16:07 abcByme 阅读(7107) 评论(2) 推荐(0)
摘要:只缩放 阅读全文
posted @ 2018-11-19 15:32 abcByme 阅读(1263) 评论(0) 推荐(0)
摘要:来自:https://blog.csdn.net/u013239236/article/details/52213977 侵删 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; char 阅读全文
posted @ 2018-11-13 09:34 abcByme 阅读(2876) 评论(0) 推荐(1)
摘要:Object.keys 返回一个所有元素为字符串的数组,其元素来自于从给定的object上面可直接枚举的属性。这些属性的顺序与手动遍历该对象属性时的一致。 // 表单清空 Object.keys(this.formValue).forEach((key) => { this.formValue[ke 阅读全文
posted @ 2018-11-08 09:20 abcByme 阅读(652) 评论(0) 推荐(0)
摘要:解决方案 可以安装整个stage2的预置器或者安装 Object Rest Operator 的babel插件 babel-plugin-transform-object-rest-spread 。 接着在babel的配置文件 .babelrc 中应用插件: { "presets": [ ["es2 阅读全文
posted @ 2018-10-19 20:46 abcByme 阅读(703) 评论(0) 推荐(0)
摘要:调用- let obj = [{"name": "1","url": "1u"}, {"name": "1","url": "1r"}, {"name": "2","url": "1u"},{ "name": "1", "url": "1u" }]; console.l 阅读全文
posted @ 2018-10-18 15:41 abcByme 阅读(4250) 评论(0) 推荐(0)
摘要:删除 阅读全文
posted @ 2018-10-11 16:58 abcByme 阅读(1291) 评论(0) 推荐(0)
摘要://es6语法export function debounce(func, delay) { let timer //返回一个函数,并拿到参数 return function (...args) { if (timer) { clearTimeout(timer) } timer = setTimeout(() => { func.ap... 阅读全文
posted @ 2018-09-28 16:37 abcByme 阅读(458) 评论(0) 推荐(0)
摘要://先定义一个某数值范围内的随机数 // 克隆数组方法 //洗牌 //调用 阅读全文
posted @ 2018-09-12 10:43 abcByme 阅读(1238) 评论(0) 推荐(0)
摘要://调用 const transform = prefixStyle('transform') const backdrop = prefixStyle('backdrop-filter') div.style[transform] = `translate3d(0,0,0)` 等同于 div.st 阅读全文
posted @ 2018-09-07 15:51 abcByme 阅读(1121) 评论(0) 推荐(0)
摘要:来自:https://blog.csdn.net/wd4java/article/details/50466633 侵删 以下我们将为大家介绍 JavaScript 保留两位小数的实现方法:四舍五入以下处理结果会四舍五入: ? 1 2 var num =2.446242342; num = num. 阅读全文
posted @ 2018-09-06 09:51 abcByme 阅读(16845) 评论(0) 推荐(1)
摘要:来自:https://blog.csdn.net/qq_37120738/article/details/79086706 侵删 slice() 定义和用法 slice() 方法可从已有的数组中返回选定的元素。 string.slice(start, end)提取一个字符串 string.subst 阅读全文
posted @ 2018-09-03 09:46 abcByme 阅读(5664) 评论(0) 推荐(2)
摘要:来自:http://www.cnblogs.com/fangshidaima/p/5910604.html 侵删 forEach是ES5中操作数组的一种方法,主要功能是遍历数组,例如: 1 2 var arr = [1,2,3,4]; arr.forEach(alert); 1 2 var arr 阅读全文
posted @ 2018-08-31 14:21 abcByme 阅读(806) 评论(0) 推荐(0)
摘要:addClass(元素, 'item-类名') 阅读全文
posted @ 2018-08-30 09:18 abcByme 阅读(3442) 评论(0) 推荐(1)
摘要:if (window["context"] == undefined) { if (!window.location.origin) { window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + wi... 阅读全文
posted @ 2018-08-22 16:56 abcByme 阅读(730) 评论(0) 推荐(0)
摘要:var shine=0.8; var arrays = ['[255,182,193,0.8]','[144,238,144,0.8]','[255,235,205,0.8]','[240,128,128,0.8]','[255,186,0,0.8]','[255,225,189,0.8]','[227,229,241,0.8]','[248,228,239,0.8]','[223,237,2... 阅读全文
posted @ 2018-08-10 16:11 abcByme 阅读(1066) 评论(1) 推荐(1)
摘要:https://www.zhangxinxu.com/wordpress/2017/07/js-text-string-download-as-html-json-file/ 侵删 1.H5 download属性 downFile(下载地址, 保存名称); 2.iframe方式 3.form方式 阅读全文
posted @ 2018-07-13 16:12 abcByme 阅读(20686) 评论(5) 推荐(1)
摘要:var tree = [ { name: 'node1' }, { name: 'node2', children: [{ name: 'node-2-1' }, { name: 'node2-2' }] }, { name: 'node3', children: [{ name: 'node-3-1', children: [{ name: 'node3-1-1' }]... 阅读全文
posted @ 2018-06-28 18:37 abcByme 阅读(3830) 评论(0) 推荐(0)