function closeDiv(){ document.getElementById('popDiv').style.display='none'; document.getElementById('bg').style.display='none'; } $(function (){ var rotateTimeOut = function (){ $('#rotate').rotate({ angle:0, animateTo:2160, duration:8000, callback:function (){ alert('网络超时,请检查您的网络设置!'); } }); }; var bRotate = false; var rotateFn = function (awards, angles, txt){ bRotate = !bRotate; $('#rotate').stopRotate(); $('#rotate').rotate({ angle:0, animateTo:angles+1800, duration:8000, callback:function (){ /*alert(txt);*/ swal({ title: txt,}); bRotate = !bRotate; } }) }; document.onkeydown=function(event){ var e = event || window.event || arguments.callee.caller.arguments[0]; if(e && e.keyCode==32){ // enter 键 $('showSweetAlert').css("display","none"); $('sweet-overlay').css("display","none"); if(bRotate)return; var item = rnd(1,5); switch (item) { case 1: //var angle = [26, 88, 137, 185, 235, 287, 337]; rotateFn(1, 55, '免费办理孩子留学一次'); break; case 2: //var angle = [88, 137, 185, 235, 287]; rotateFn(2, 140, '当即签约服务费打五折'); break; case 3: //var angle = [137, 185, 235, 287]; rotateFn(3, 199, '项目考察的来回飞机票'); break; case 4: //var angle = [137, 185, 235, 287]; rotateFn(4, 269, '价值1万2的汽车加油卡'); break; case 5: //var angle = [185, 235, 287]; rotateFn(5, 341, '价值1万5的空气净化器'); break; } console.log(item); } }; $('.pointer').click(function (){ if(bRotate)return; var item = rnd(1,5); switch (item) { case 1: //var angle = [26, 88, 137, 185, 235, 287, 337]; rotateFn(1, 55, '免费办理孩子留学一次'); break; case 2: //var angle = [88, 137, 185, 235, 287]; rotateFn(2, 140, '当即签约服务费打五折'); break; case 3: //var angle = [137, 185, 235, 287]; rotateFn(3, 199, '项目考察的来回飞机票'); break; case 4: //var angle = [137, 185, 235, 287]; rotateFn(4, 269, '价值1万2的汽车加油卡'); break; case 5: //var angle = [185, 235, 287]; rotateFn(5, 341, '价值1万5的空气净化器'); break; } console.log(item); }); }); function rnd(n, m){ return Math.floor(Math.random()*(m-n+1)+n) }
pointer
turntable
$(function(){ (function(){ function loadImage(){ var imgContainers=$(".imgContainer"); var length=imgContainers.length; var index=0; var item=null; var imgUrl=null; getImg(); function getImg(){ item=imgContainers.eq(index); imgUrl=item.attr("imgUrl"); if(imgUrl!=null || imgUrl!=undefined) { var image=new Image(); image.onload=function(){ item.css({"opacity":"1"}); item.css({"background-image":"url("+imgUrl+")","opacity":"1"}); index++; if(index