摘要: (function() { var lastTime = 0; var vendors = ['webkit', 'moz']; for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { window.requestAnimationFrame = window[v... 阅读全文
posted @ 2018-12-11 18:37 炒份黄瓜 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 点我绑定事件 阅读全文
posted @ 2018-12-04 21:33 炒份黄瓜 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Function.prototype.bind = function(){ var self = this, // 保存原函数 context = [].shift.call( arguments ), // 需要绑定的 this 上下文 args = [].slice.call( arguments ); // 剩余的参数转成数组 return function(){ // ... 阅读全文
posted @ 2018-12-04 21:15 炒份黄瓜 阅读(76) 评论(0) 推荐(0) 编辑
摘要: let reg =/([^?&+#]+)=([^?&+#]+)/g; let obj={}; let href = 'http://www.runoob.com/jquery/misc-trim.html?channelid=12333&name=xiaoming&age=23'; href.replace(reg,($0,$1,$2)=>obj[$1]=$2) console.log(obj)... 阅读全文
posted @ 2018-12-04 11:28 炒份黄瓜 阅读(457) 评论(0) 推荐(0) 编辑
摘要: function redRain(){ var redPacketCreateTime = 200 var redPacket = $('') var docWidth = $(document).width() var redBoxWith = $('.red-real-box').width() var redBoxHeight = $('.red-r... 阅读全文
posted @ 2018-08-13 16:19 炒份黄瓜 阅读(260) 评论(0) 推荐(0) 编辑
摘要: function base64ToBlob(base64) { var arr = base64.split(','); var mime = arr[0].match(/:(.*?);/)[1] || 'image/png'; // 去掉url的头,并转化为byte var bytes = window.atob(arr[1]); // 处理异常,将ascii码小于0的转换为大于0 ... 阅读全文
posted @ 2018-08-13 15:57 炒份黄瓜 阅读(495) 评论(0) 推荐(0) 编辑