当前路径: 星河码客 » 插件特效 » html5制作刮刮卡抽奖专题页面_jquery手机端刮刮卡抽奖代码

html5制作刮刮卡抽奖专题页面_jquery手机端刮刮卡抽奖代码

//控制刮卡次数 var t = 1; //初始化所有数据并且随机产生奖品 var initialize = function () { //剩余刮卡次数 $('.num1').html(4-t); //随机数 function getRandomNum(lbound, ubound) { return (Math.floor(Math.random() * (ubound - lbound)) + lbound); } var r = getRandomNum(1,100); var btn = document.getElementsByClassName("btn"); for(var i=0; i=a.data.length/8){ isOk = 1; } ismousedown=false; } //鼠标移动 和 触摸移动 function eventMove(e){ e.preventDefault(); if(ismousedown) { if(e.changedTouches){ e=e.changedTouches[e.changedTouches.length-1]; } var topY = document.getElementById("top").offsetTop; var oX = c1.offsetLeft, oY = c1.offsetTop+topY; var x = (e.clientX + document.body.scrollLeft || e.pageX) - oX || 0, y = (e.clientY + document.body.scrollTop || e.pageY) - oY || 0; //画360度的弧线,就是一个圆,因为设置了ctx.globalCompositeOperation = 'destination-out'; //画出来是透明的 ctx.beginPath(); ctx.arc(x, y, fontem*1.2, 0, Math.PI * 2,true); //下面3行代码是为了修复部分手机浏览器不支持destination-out //我也不是很清楚这样做的原理是什么 c1.style.display = 'none'; c1.offsetHeight; c1.style.display = 'inherit'; ctx.fill(); } if(isOk){ var btn = document.getElementsByClassName("btn"); for(var i=0; i

html5制作刮刮卡抽奖专题页面_jquery手机端刮刮卡抽奖代码

在线演示        积分下载        6毛下载        砍两刀下载       

文件目录······
暂无数据
 猜你喜欢 更多»
 工具推荐 更多»