Home > Web Front-end > JS Tutorial > body text

jQuery Lucky Wheel

巴扎黑
Release: 2016-12-06 13:58:46
Original
1267 people have browsed it

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>jQuery幸运大转盘_jQuery+PHP抽奖程序(上)</title>
        <style type="text/css">
            .demo{ position:relative;width:417px;}
            #disk{width:417px; height:417px; background:url(/api/jq/5733e347040d9/images/disk.jpg) no-repeat;}
            #start{width:163px; height:320px; position:absolute; top:46px; left:130px;}
            #start img{cursor:pointer}
        </style>
    </head>
    <body>
        <div class="container">
            <div class="demo">
                <div id="disk"></div>
                <div id="start"><img src="/api/jq/5733e347040d9/images/start.png" id="startbtn" alt="转盘开启"/></div>
            </div>
        </div>
        <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.7.2/jquery.min.js"></script>
        <script type="text/javascript" src="/api/jq/5733e347040d9/jQueryRotate.2.2.js"></script>
        <script type="text/javascript" src="/api/jq/5733e347040d9/jquery.easing.min.js"></script>
        <script type="text/javascript">
            $(function() {
                $("#startbtn").rotate({
                    bind: {
                        click: function() {
                            var random = Math.floor(Math.random() * 360); //生成随机数
                            $(this).rotate({
                                duration: 3000, //转动时间间隔(速度单位ms)
                                angle: 0, //指针开始角度
                                animateTo: 3600 + random, //转动角度,当转动角度到达3600+random度时停止转动。
                                easing: $.easing.easeOutSine, //easing动画效果
                                callback: function() {  //回调函数
                                    alert(&#39;恭喜您,中奖了!&#39;);
                                }
                            });
                        }
                    }
                });
            });
        </script>
    </body>
</html>
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!