jquery 大轉盤,jQueryRotate,源碼

來源:互聯網
上載者:User

<!DOCTYPE html><html><head>    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">    <title>jquery圓形轉盤抽獎</title>    <script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>    <script type="text/javascript" src="js/jQueryRotate.2.2.js"></script>    <script type="text/javascript" src="js/jquery.easing.min.js"></script>    <style type="text/css">        /*背景*/        #lottery {            width: 450px;            height: 450px;            position: relative;            background: url("images/disc-bg.gif") no-repeat scroll 0 0 transparent;            z-index: 99991;            margin: 0px auto;            margin-top: 30px;        }            /*轉盤*/            #lottery .img {                position: absolute;                left: 49px;                top: 49px;                width: 352px;                height: 352px;                z-index: 99992;            }            /*指標*/            #lottery .arrow {                width: 32px;                height: 191px;                position: absolute;                left: 209px;                top: 85px;                background: url("images/arrow.png") no-repeat scroll 0 0 transparent;                z-index: 99993;            }            /*抽獎按鈕*/            #lottery .lot-btn {                width: 92px;                height: 92px;                display: block;                position: absolute;                cursor: pointer;                left: 179px;                top: 183px;                overflow: hidden;                background: url("images/buttons_01.png") no-repeat scroll 0 0 transparent;                z-index: 99994;            }    </style></head><body>    <div id="lottery">        <img src="images/disc-rotate.gif" class="img" />        <div class="arrow"></div>        <div class="lot-btn" onclick="javascript:DZP(10,6);"></div>    </div></body></html><script>    //先轉n圈,選擇m第個    function DZP(n, m) {        //停止動畫        $('.img').stopRotate();        //轉        $(".img").rotate({            angle: 0,  //起始角度            animateTo: 360 * n + 26 + 52 * m,  //結束的角度            duration: 2500, //轉動時間            callback: function () {                //得到角度                var r = $('.img').getRotateAngle();            }, //回呼函數            easing: $.easing.stopRotare //定義運動的效果,需要引用jquery.easing.min.js的檔案        });    }</script>


源碼:http://download.csdn.net/detail/dhfekl/7106035


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.