标签:
1.判断在页面是鼠标的click事件还是手机移动端的tap事件
var _click = "ontouchend" in document ? "tap" : "click";2.产生随机数组
Math.RandomNumbers = function (rn, rcount, bn, bcount) { var ret = []; var re = []; for (var i = 0; i < rcount; i++) { ret[i] = Math.ceil(Math.random()*(rn-1)+1); ret[i] = ret[i]<10?‘0‘+ret[i]:ret[i]; } for (var i = 0; i < bcount; i++) { re[i] = Math.ceil(Math.random()*(bn-1)+1); ret.push(re[i]<10?‘0‘+re[i]:re[i]); }; return ret; }
标签:
原文地址:http://my.oschina.net/u/2328177/blog/467232