亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jQuery實(shí)現(xiàn)移動(dòng)端扭蛋機(jī)抽獎(jiǎng)

 更新時(shí)間:2020年11月08日 14:24:20   作者:碼奴生來(lái)只知道前進(jìn)~  
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)移動(dòng)端扭蛋機(jī)抽獎(jiǎng),文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了jQuery實(shí)現(xiàn)移動(dòng)端扭蛋機(jī)抽獎(jiǎng)的具體代碼,供大家參考,具體內(nèi)容如下

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="apple-touch-fullscreen" content="YES" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="pragram" content="no-cache" />
 
<link href="css/style.css" type="text/css" rel="stylesheet"/>
 
<title>扭蛋機(jī)</title>
<!--移動(dòng)端版本兼容 -->
<script type="text/javascript">
 var phoneWidth = parseInt(window.screen.width);
 var phoneScale = phoneWidth/640;
 var ua = navigator.userAgent;
 if (/Android (\d+\.\d+)/.test(ua)){
 var version = parseFloat(RegExp.$1);
 // andriod 2.3
 if(version>2.3){
  document.write('<meta name="viewport" content="width=640, minimum-scale = '+phoneScale+', maximum-scale = '+phoneScale+', target-densitydpi=device-dpi">');
 // andriod 2.3以上
 }else{
  document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');
 }
 // 其他系統(tǒng)
 } else {
 document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
 }
 //微信去掉下方刷新欄
 if(RegExp("MicroMessenger").test(navigator.userAgent)){
 document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
  WeixinJSBridge.call('hideToolbar');
 });
 }
</script>
 
 <script src="js/jquery1.8.3.min.js"></script>
 
</head>
<body>
 
<div class="niu_danji">
 <!--機(jī)器-->
 <div class="game_qu">
 <!--go-->
 <div class="game_go">100/次</div>
  <div class="wdjifen">10000</div>
 </div>
 
 <!--球-->
 <div class="dan_gund">
 <span class="qiu_1 diaol_1"></span>
 <span class="qiu_2 diaol_2"> </span>
 <span class="qiu_3 diaol_3"></span>
 
 <span class="qiu_4 diaol_4"></span>
 <span class="qiu_5 diaol_5"></span>
 <span class="qiu_6 diaol_6"></span>>
 
 <span class="qiu_7 diaol_7"></span>
 <span class="qiu_8 diaol_8"></span>
 
 
 <span class="qiu_9 diaol_9"></span>
 <span class="qiu_10 diaol_10"></span> 
 <span class="qiu_11 diaol_11"></span> 
  
 </div>
 
 <!--中獎(jiǎng)掉落-->
 <div class="medon"><img src="images/mendong.png"/></div>
 <div class="zjdl ">
 <span></span>
 </div>
 
 </div>
 
 
 
 
<!--中獎(jiǎng) 獲得一等獎(jiǎng)-->
<div class="zonj_zezc none" id="jianpin_one">
 <div class="jpzs aiqiyi tc_anima">
 <em><img src="images/close.png"/></em>
 <h2>
  <b>恭喜你!<br>獲得一等獎(jiǎng)!</b>
 </h2>
 </div></div>
 
<!--中獎(jiǎng)獲得二等獎(jiǎng)-->
<div class="zonj_zezc none" id="jianpin_two">
 <div class="jpzs aiqiyi tc_anima">
 <em><img src="images/close.png"/></em>
 <h2>
  <b>恭喜你!<br>獲得二等獎(jiǎng)!</b>
 </h2>
 </div>
</div>
 
<!--中獎(jiǎng) 獲得三等獎(jiǎng)-->
<div class="zonj_zezc none" id="jianpin_three">
 <div class="jpzs aiqiyi tc_anima">
 <em><img src="images/close.png"/></em>
 <h2>
  <b>恭喜你!<br>獲得三等獎(jiǎng)!</b>
 </h2>
 </div>
</div>
 
 
<!--沒(méi)有中獎(jiǎng)-->
<div class="zonj_zezc none" id="jianpin_kong">
 <div class="jpzs aiqiyi tc_anima">
 <em><img src="images/close.png"/></em>
 <h2>
  咦?沒(méi)有抽中?
 </h2>
 </div>
</div>
 
 
<!--積分不足-->
<div class="zonj_zezc none" id="no_jifeng">
 <div class="jpzs aiqiyi tc_anima">
 <em><img src="images/close.png"/></em>
 <h2>
  對(duì)不起,積分不足!
 </h2>
 </div>
</div>
<script>
 
$(document).ready(function(e) {
 //一等獎(jiǎng) 關(guān)閉
 $("#jianpin_one em img").click(function(){
 $("#jianpin_one").hide();
 }
 ); 
 //二等獎(jiǎng) 關(guān)閉
 $("#jianpin_two em img").click(function(){
 $("#jianpin_two").hide();
 }
 ); 
 //三等獎(jiǎng) 關(guān)閉
 $("#jianpin_three em img").click(function(){
 $("#jianpin_three").hide();
 }
 ); 
 //沒(méi)有中獎(jiǎng) 關(guān)閉
 $("#jianpin_kong em img").click(function(){
 $("#jianpin_kong").hide();
 }
 ); 
 //積分不足 關(guān)閉
 $("#no_jifeng em img").click(function(){
 $("#no_jifeng").hide();
 }
 ); 
 
var score=470;
$(".wdjifen").html(score);
 
 
$(".game_go").click(function(){
 score-=100;
 if(score<0){
 for(i=1;i<=11;i++){
 $(".qiu_"+i).removeClass("wieyi_"+i);
 }
 $("#no_jifeng").show();
 }else{
 draw()
 }
 });
 
 
function draw(){
 var number =Math.floor(4*Math.random()+1); 
 
 for(i=1;i<=11;i++){
 $(".qiu_"+i).removeClass("diaol_"+i);
 $(".qiu_"+i).addClass("wieyi_"+i);
 };
 
 setTimeout(function (){
 for(i=1;i<=11;i++){
 $(".qiu_"+i).removeClass("wieyi_"+i);
 }
 },1100); 
 setTimeout(function(){
 switch(number){
 case 1:$(".zjdl").children("span").addClass("diaL_one");break;
 case 2:$(".zjdl").children("span").addClass("diaL_two");break;
 case 3:$(".zjdl").children("span").addClass("diaL_three");break;
 case 4:$(".zjdl").children("span").addClass("diaL_four");break;
 }
 $(".zjdl").removeClass("none").addClass("dila_Y");
 setTimeout(function (){
 switch(number){
 case 1:$("#jianpin_one").show();break;
 case 2:$("#jianpin_two").show();break;
 case 3:$("#jianpin_three").show();break;
 case 4:$("#jianpin_kong").show();break;
 }
 },900);
 },1100)
 
 //取消動(dòng)畫(huà)
 setTimeout(function (){
 $(".zjdl").addClass("none").removeClass("dila_Y");
 $(".wdjifen").html(score);
 $(".zjdl").children("span").removeAttr('class');
 
 },2500)
 
} 
});
 
 
</script>
 
 
</body>
</html>

 

demo下載地址:jQuery移動(dòng)端扭蛋機(jī)抽獎(jiǎng)

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • 如何使用jQuery操作Cookies方法解析

    如何使用jQuery操作Cookies方法解析

    這篇文章主要介紹了如何使用jQuery操作Cookies方法解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-09-09
  • 基于jQuery封裝的分頁(yè)組件

    基于jQuery封裝的分頁(yè)組件

    這篇文章主要為大家詳細(xì)介紹了基于jQuery封裝的分頁(yè)組件,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-06-06
  • 深入理解jQuery事件綁定

    深入理解jQuery事件綁定

    下面小編就為大家?guī)?lái)一篇深入理解jQuery事件綁定。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2016-06-06
  • Jquery工作常用實(shí)例 使用AJAX使網(wǎng)頁(yè)進(jìn)行異步更新

    Jquery工作常用實(shí)例 使用AJAX使網(wǎng)頁(yè)進(jìn)行異步更新

    AJAX 通過(guò)在后臺(tái)與服務(wù)器交換少量數(shù)據(jù)的方式,允許網(wǎng)頁(yè)進(jìn)行異步更新。這意味著有可能在不重載整個(gè)頁(yè)面的情況下,對(duì)網(wǎng)頁(yè)的一部分進(jìn)行更新。
    2011-07-07
  • 簡(jiǎn)單的jquery拖拽排序效果實(shí)現(xiàn)代碼

    簡(jiǎn)單的jquery拖拽排序效果實(shí)現(xiàn)代碼

    寫(xiě)了簡(jiǎn)單的跟隨鼠標(biāo)移動(dòng)效果。這個(gè)拖拽排序的效果的區(qū)別在于: 運(yùn)用了插入insertBefore 和 insertAfter 的方法
    2011-09-09
  • jquery判斷checkbox(復(fù)選框)是否被選中的代碼

    jquery判斷checkbox(復(fù)選框)是否被選中的代碼

    現(xiàn)在很多朋友都喜歡使用jquery了,所以很多的表格判斷都是基于jquery的,但實(shí)現(xiàn)方法與javascript原生代碼不同,對(duì)于checkbox的判斷大家可以參考下。
    2010-10-10
  • jQuery中extend函數(shù)簡(jiǎn)單用法示例

    jQuery中extend函數(shù)簡(jiǎn)單用法示例

    這篇文章主要介紹了jQuery中extend函數(shù)簡(jiǎn)單用法,結(jié)合實(shí)例形式簡(jiǎn)單分析了jQuery使用extend函數(shù)擴(kuò)展對(duì)象屬性的相關(guān)操作技巧,需要的朋友可以參考下
    2017-10-10
  • jQuery實(shí)現(xiàn)TAB風(fēng)格的全國(guó)省份城市滑動(dòng)切換效果代碼

    jQuery實(shí)現(xiàn)TAB風(fēng)格的全國(guó)省份城市滑動(dòng)切換效果代碼

    這篇文章主要介紹了jQuery實(shí)現(xiàn)TAB風(fēng)格的全國(guó)省份城市滑動(dòng)切換效果代碼,涉及jquery鼠標(biāo)mouseover事件及頁(yè)面元素遍歷的相關(guān)技巧,非常具有實(shí)用價(jià)值,需要的朋友可以參考下
    2015-08-08
  • jQuery中創(chuàng)建實(shí)例與原型繼承揭秘

    jQuery中創(chuàng)建實(shí)例與原型繼承揭秘

    在普通情況下我們要用原生類(lèi)、或者自定義類(lèi)創(chuàng)建實(shí)例要用new運(yùn)算符,使構(gòu)造函數(shù)創(chuàng)建一個(gè)實(shí)例,并且實(shí)例繼承構(gòu)造器prototype上的所有公有方法
    2011-12-12
  • jQuery實(shí)現(xiàn)給input綁定回車(chē)事件的方法

    jQuery實(shí)現(xiàn)給input綁定回車(chē)事件的方法

    這篇文章主要介紹了jQuery實(shí)現(xiàn)給input綁定回車(chē)事件的方法,結(jié)合實(shí)例形式分析了2種常用的事件綁定操作技巧,需要的朋友可以參考下
    2017-02-02

最新評(píng)論