摘要: var ImageResizer = function(opts) { var settings = { resizeMode: "auto", //压缩模式,总共有三种 auto,width,height auto表示自动根据最大的宽度及高度等比压缩,width表示只根据宽度来判断是否需要等比例压 阅读全文
posted @ 2020-07-24 15:45 孑孓_0209 阅读(263) 评论(0) 推荐(0) 编辑
摘要: $('input').change(function(e){ console.log(e) console.log(e.target) console.log(e.target.size)//得到的单位为b }) 阅读全文
posted @ 2020-07-24 15:39 孑孓_0209 阅读(380) 评论(0) 推荐(0) 编辑
摘要: average(code,start,end) {//平均数 let arr = [] let total = 0 for(let i =start; i<=end;i++) { arr.push(this[code+i]?this[code+i]:0) } for(let i=0;i<arr.le 阅读全文
posted @ 2020-07-13 15:00 孑孓_0209 阅读(117) 评论(0) 推荐(0) 编辑
摘要: rem rem是相对根元素html字号的相对单位(一般默认字号是16px,那么1rem=16px) <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1"> 为了兼容谷歌浏览器(默认12px), 阅读全文
posted @ 2020-07-03 16:04 孑孓_0209 阅读(101) 评论(0) 推荐(0) 编辑
摘要: // iPhone X、iPhone XS let isIPhoneX = /iphone/gi.test(window.navigator.userAgent) && window.devicePixelRatio && (window.devicePixelRatio 2 || window.d 阅读全文
posted @ 2020-07-03 11:15 孑孓_0209 阅读(191) 评论(0) 推荐(0) 编辑