摘要: /* normalize.css */ html { line-height: 1.15; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */ } body { margin: 0; 阅读全文
posted @ 2021-12-06 10:45 九月九九八 阅读(42) 评论(0) 推荐(0)
摘要: /* normalize.css */ html { line-height: 1.15; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */ } body { margin: 0; 阅读全文
posted @ 2021-12-06 10:44 九月九九八 阅读(59) 评论(0) 推荐(0)
摘要: /*获取网址参数*/ getURL(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null) return 阅读全文
posted @ 2021-12-06 10:43 九月九九八 阅读(32) 评论(0) 推荐(0)
摘要: class StorageFn { constructor () { this.ls = window.localStorage; this.ss = window.sessionStorage; } /* cookie */ /*设置cookie*/ setCookie (name, value, 阅读全文
posted @ 2021-12-06 10:42 九月九九八 阅读(395) 评论(0) 推荐(0)
摘要: /** * @param {setting} */ ajax(setting){ //设置参数的初始值 var opts={ method: (setting.method || "GET").toUpperCase(), //请求方式 url: setting.url || "", // 请求地址 阅读全文
posted @ 2021-12-06 10:41 九月九九八 阅读(106) 评论(0) 推荐(0)
摘要: /*随机数范围*/ random (min, max) { if (arguments.length 2) { return Math.floor(min + Math.random() * ( (max+1) - min )) }else{ return null; } } /*将阿拉伯数字翻译成 阅读全文
posted @ 2021-12-06 10:41 九月九九八 阅读(65) 评论(0) 推荐(0)
摘要: /** * 去除空格 * @param {str} * @param {type} * type: 1-所有空格 2-前后空格 3-前空格 4-后空格 * @return {String} */ trim (str, type) { type = type || 1 switch (type) { 阅读全文
posted @ 2021-12-06 10:40 九月九九八 阅读(37) 评论(0) 推荐(0)
摘要: /*判断一个元素是否在数组中*/ contains (arr, val) { return arr.indexOf(val) != -1 ? true : false; } /** * @param {arr} 数组 * @param {fn} 回调函数 * @return {undefined} 阅读全文
posted @ 2021-12-06 10:39 九月九九八 阅读(69) 评论(0) 推荐(0)
摘要: /** * 格式化时间 * * @param {time} 时间 * @param {cFormat} 格式 * @return {String} 字符串 * * @example formatTime('2018-1-29', '{y}/{m}/{d} {h}:{i}:{s}') // -> 20 阅读全文
posted @ 2021-12-06 10:36 九月九九八 阅读(282) 评论(0) 推荐(0)