• <big id="p4ykw"><output id="p4ykw"></output></big>
    <small id="p4ykw"></small>
    \r\n         

    KinerLotter——大轉(zhuǎn)盤<\/h1>\r\n    \r\n        <\/div>\r\n        \r\n        <\/div>\r\n    <\/div>\r\n    

    国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

    首頁 web前端 html教學(xué) html5製作轉(zhuǎn)盤的詳解及實(shí)例

    html5製作轉(zhuǎn)盤的詳解及實(shí)例

    Dec 02, 2017 pm 01:07 PM
    h5 html5 實(shí)例

    今天帶給大家的案列是html5轉(zhuǎn)盤實(shí)例,可以直接拿來做抽獎(jiǎng)程序,有需要的朋友可以拿去使用,下面是案列代碼。

    <!DOCTYPE html>
    <html>
     
    <head>
        <meta charset="UTF-8">
        <title>html5制作轉(zhuǎn)盤游戲 </title>
             <meta name="keywords" content=" html5制作轉(zhuǎn)盤游戲 " />
             <meta name="description" content=" html5制作轉(zhuǎn)盤游戲 " />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <link rel="stylesheet" href="css/kinerLottery.css">
        <style>  
             h1{
                       width: 100%;
                       height: 3rem;
                       line-height: 3rem;
                       font-size: 1.8rem;
                       color:#c60;
                       text-align: center;
                       font-weight: bolder;
             }
     
        </style>
    </head>
    <body>
             <h1>KinerLotter——大轉(zhuǎn)盤</h1>
        <div id="box">
            <div class="outer KinerLottery KinerLotteryContent"><img src="./imgs/lotteryContent.png"></div>
            <!-- 大專盤分為三種狀態(tài):活動(dòng)未開始(no-start)、活動(dòng)進(jìn)行中(start)、活動(dòng)結(jié)束(completed),可通過切換class進(jìn)行切換狀態(tài),js會(huì)根據(jù)這3個(gè)class進(jìn)行匹配狀態(tài) -->
            <div class="inner KinerLotteryBtn start"></div>
        </div>
        <script src="js/zepto.min.js"></script>
        <script src="js/kinerLottery.js"></script>
        <script>
        /**
         * 根據(jù)轉(zhuǎn)盤旋轉(zhuǎn)角度判斷獲得什么獎(jiǎng)品
         * @param deg
         * @returns {*}
         */
        var whichAward = function(deg) {
            if ((deg > 330 && deg <= 360) || (deg > 0 && deg <= 30)) { //10M流量
                return "三網(wǎng)通流量 10M";
            } else if ((deg > 30 && deg <= 90)) { //IPhone 7
                return "iPhone7";
            } else if (deg > 90 && deg <= 150) { //30M流量
                return "三網(wǎng)通流量 30M";
            } else if (deg > 150 && deg <= 210) { //5元話費(fèi)
                return "話費(fèi)5元";
            } else if (deg > 210 && deg <= 270) { //IPad mini 4
                return "ipad mini4";
            } else if (deg > 270 && deg <= 330) { //20元話費(fèi)
                return "話費(fèi)20元";
            }
        }
     
        var KinerLottery = new KinerLottery({
            rotateNum: 8, //轉(zhuǎn)盤轉(zhuǎn)動(dòng)圈數(shù)
            body: "#box", //大轉(zhuǎn)盤整體的選擇符或zepto對(duì)象
            direction: 0, //0為順時(shí)針轉(zhuǎn)動(dòng),1為逆時(shí)針轉(zhuǎn)動(dòng)
            disabledHandler: function(key) {
                switch (key) {
                    case "noStart":
                        alert("活動(dòng)尚未開始");
                        break;
                    case "completed":
                        alert("活動(dòng)已結(jié)束");
                        break;
                }
            }, //禁止抽獎(jiǎng)時(shí)回調(diào)
            clickCallback: function() {
                //此處訪問接口獲取獎(jiǎng)品
                function random() {
                    return Math.floor(Math.random() * 360);
                }
                this.goKinerLottery(random());
            }, //點(diǎn)擊抽獎(jiǎng)按鈕,再次回調(diào)中實(shí)現(xiàn)訪問后臺(tái)獲取抽獎(jiǎng)結(jié)果,拿到抽獎(jiǎng)結(jié)果后顯示抽獎(jiǎng)畫面
            KinerLotteryHandler: function(deg) {
                    alert("恭喜您獲得:" + whichAward(deg));
                } //抽獎(jiǎng)結(jié)束回調(diào)
        });
        </script>
    </body>
     
    </html>


    相信看了這些案例你已經(jīng)掌握了方法,更多精彩請(qǐng)關(guān)注php中文網(wǎng)其它相關(guān)文章!

    相關(guān)閱讀:

    以Js操作HTTP的Cookie的實(shí)作步驟

    html 邊框虛線的實(shí)作步驟

    AJAX的常用語法是什麼

    #

    以上是html5製作轉(zhuǎn)盤的詳解及實(shí)例的詳細(xì)內(nèi)容。更多資訊請(qǐng)關(guān)注PHP中文網(wǎng)其他相關(guān)文章!

    本網(wǎng)站聲明
    本文內(nèi)容由網(wǎng)友自願(yuàn)投稿,版權(quán)歸原作者所有。本站不承擔(dān)相應(yīng)的法律責(zé)任。如發(fā)現(xiàn)涉嫌抄襲或侵權(quán)的內(nèi)容,請(qǐng)聯(lián)絡(luò)admin@php.cn

    熱AI工具

    Undress AI Tool

    Undress AI Tool

    免費(fèi)脫衣圖片

    Undresser.AI Undress

    Undresser.AI Undress

    人工智慧驅(qū)動(dòng)的應(yīng)用程序,用於創(chuàng)建逼真的裸體照片

    AI Clothes Remover

    AI Clothes Remover

    用於從照片中去除衣服的線上人工智慧工具。

    Clothoff.io

    Clothoff.io

    AI脫衣器

    Video Face Swap

    Video Face Swap

    使用我們完全免費(fèi)的人工智慧換臉工具,輕鬆在任何影片中換臉!

    熱工具

    記事本++7.3.1

    記事本++7.3.1

    好用且免費(fèi)的程式碼編輯器

    SublimeText3漢化版

    SublimeText3漢化版

    中文版,非常好用

    禪工作室 13.0.1

    禪工作室 13.0.1

    強(qiáng)大的PHP整合開發(fā)環(huán)境

    Dreamweaver CS6

    Dreamweaver CS6

    視覺化網(wǎng)頁開發(fā)工具

    SublimeText3 Mac版

    SublimeText3 Mac版

    神級(jí)程式碼編輯軟體(SublimeText3)

    理解H5:含義和意義 理解H5:含義和意義 May 11, 2025 am 12:19 AM

    H5是HTML5,是HTML的第五個(gè)版本。 HTML5提升了網(wǎng)頁的表現(xiàn)力和交互性,引入了語義化標(biāo)籤、多媒體支持、離線存儲(chǔ)和Canvas繪圖等新特性,推動(dòng)了Web技術(shù)的發(fā)展。

    HTML5:限制 HTML5:限制 May 09, 2025 pm 05:57 PM

    HTML5hasseverallimitationsincludinglackofsupportforadvancedgraphics,basicformvalidation,cross-browsercompatibilityissues,performanceimpacts,andsecurityconcerns.1)Forcomplexgraphics,HTML5'scanvasisinsufficient,requiringlibrarieslikeWebGLorThree.js.2)I

    HTML5的重要目標(biāo):增強(qiáng)網(wǎng)絡(luò)開發(fā)和用戶體驗(yàn) HTML5的重要目標(biāo):增強(qiáng)網(wǎng)絡(luò)開發(fā)和用戶體驗(yàn) May 14, 2025 am 12:18 AM

    html5aimstoenhancewebdevelopmentanduserexperiencethroughsemantstructure,多媒體綜合和performanceimprovements.1)SemanticeLementLike like,和ImproVereAdiability and ImproVereAdabilityActibility.2)and tagsallowsemlessallowseamelesseamlessallowseamelesseamlesseamelesseamemelessmultimedimeDiaiaembediiaembedplugins.3)。 3)3)

    什麼是微數(shù)據(jù)? HTML5解釋了 什麼是微數(shù)據(jù)? HTML5解釋了 Jun 10, 2025 am 12:09 AM

    MicrodataenhancesSEOandcontentdisplayinsearchresultsbyembeddingstructureddataintoHTML.1)Useitemscope,itemtype,anditempropattributestoaddsemanticmeaning.2)ApplyMicrodatatokeycontentlikebooksorproductsforrichsnippets.3)BalanceusagetoavoidclutteringHTML

    HTML5 microdata:最好的在線工具 HTML5 microdata:最好的在線工具 Jun 09, 2025 am 12:06 AM

    thebestonlinetoolsforhtml5microdataaregooglestructuctureddatamarkuphelperandschema.org'smarkupvalidator.1)googlestructuctuctructuctureddatama RKUPHELPERISUSER友好型,GuidinguserstoAddmicrodatatagsforenhancedseo.2)schema.org'smarkupvalidatoratorChecksmicrodatiaimplementa

    HTML5:使用新功能和功能轉(zhuǎn)換網(wǎng)絡(luò) HTML5:使用新功能和功能轉(zhuǎn)換網(wǎng)絡(luò) May 11, 2025 am 12:12 AM

    html5transformswebdevelopmentbyIntroducingSemanticlements,多種型,功能強(qiáng)大,功能性和表現(xiàn)性影響力圖。 1)semanticelementslike,,, andenhanceseoandAcccostibility.2)多層次andablawlyementsandablowemediaelementsandallawallawaldawallawaldawallawallawallawallawallawallawallawallallownallownallownallownallownallowembedembbeddingwithingwithingwithoutplugins iff inform

    HTML5:2024年的目標(biāo) HTML5:2024年的目標(biāo) May 13, 2025 am 12:13 AM

    html5'sgoalsin2024focusonrefinement和optimization,notNewFeatures.1)增強(qiáng)performanceandeffipedroptimizedRendering.2)inviveAccessibilitywithRefinedwithRefinedTributesAndEllements.3)explityconcerns,尤其是withercercern.4.4)

    HTML5的目的:創(chuàng)建一個(gè)更強(qiáng)大,更容易訪問的網(wǎng)絡(luò) HTML5的目的:創(chuàng)建一個(gè)更強(qiáng)大,更容易訪問的網(wǎng)絡(luò) May 14, 2025 am 12:18 AM

    html5aimstoenhancewebcapabilities,Makeitmoredynamic,互動(dòng),可及可訪問。 1)ITSupportsMultimediaElementsLikeAnd,消除innewingtheneedtheneedtheneedforplugins.2)SemanticeLelelemeneLementelementsimproveaCceccessibility inmproveAccessibility andcoderabilitile andcoderability.3)emply.3)lighteppoperable popperappoperable -poseive weepivewebappll

    See all articles