大转盘游戏

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
   <style>
    .pointer{
    position: absolute;
    top: 90px;
    left: 138px;
    z-index: 2;
    }
   </style>
</head>
<body>
<div class="pointer"><img src="img/pointer.png" alt="pointer"/></div>
     <img src="img/turntable2.png" id="img" /><br />
             文字<input type="text" id="txt" /><br /><br />
    <input type="button" value="旋转" οnclick="f_play($('#txt').val())" />
    <input type="button" value="恢复" οnclick="f_stop($('#txt').val())" />
    
     <script src="js/jquery-1.7.1.min.js"></script>
    <script type="text/javascript">
//   var model = { "1": -332, "2": -280, "3": -228, "4": -180  , "5":-130 , "6": -80 , "7": -26 };
        var model = { "七": -332, "夕": -280, "浪": -228, "漫": -180  , "价":-130 , "给": -80 , "你": -26 };
        function f_play(v) {
            $("#img").css("transition", " All 3s ease").css("transform", "rotate(" + (model[v] - ((Math.random() * 10).toFixed(0) * 360)) + "deg)");
            setTimeout(function(){alert("恭喜抽中【"+v+"】");},3000);
        }
        function f_stop() {
            $("#img").css("transition", " All 0s ease-in-out").css("transform", "rotate(0deg)");
        }
    </script>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值