网站首页 首页
---3个月没有写JS代码啦.......
发布时间:2017-12-22 03:22查看次数:2717
---3个月没有写JS代码啦.......
每天都在干商务,策划的事情,好像回到简简单单就写代码的时代!
羡慕道哥,农夫码工,潇洒啊!
什么闭包,什么对象化.什么深复制,浅复制....都忘记的差不多了!!!!
什么动效,定时器...........
2018年了 三年的最后一年, 不忘初心 一路前行
深圳 龙华 德玛西亚!!!
<script> var pei_lv = 100; var kai = $("#kai"); var gao = $("#gao"); var gao_num =parseInt(gao.text()); var all_ok = new Array(14); all_ok [0] = "0" all_ok [1] = "1" all_ok [2] = "2" all_ok [3] = "3" all_ok [4] = "4" all_ok [5] = "5" all_ok [6] = "6" all_ok [7] = "7" all_ok [8] = "8" all_ok [9] = "9" all_ok [10] ="10" all_ok [11] ="11" all_ok [12] ="12" all_ok [13] ="13" all_ok [14] ="14" all_ok [15] ="15" console.log(all_ok); //加注 $(document).on("click",".jia",function(e){ var self = $(this); var i_data = self.attr("myData"); var O_touzhu = $("#touzhu"+i_data); var O_peifu = $("#peifu"+i_data); var O_jieguo = $("#jieguo" + i_data); var touzhu_num = parseInt(O_touzhu.text()); O_touzhu.text( touzhu_num + 1); var touzhu_num = parseInt(O_touzhu.text()); var peifu_num = (touzhu_num * pei_lv) * 1.5; O_peifu.text (peifu_num) shezhiOK(parseInt(i_data),peifu_num); }) //减注 $(document).on("click",".jian",function(e){ var self = $(this); var i_data = self.attr("myData"); var O_touzhu = $("#touzhu"+i_data); var O_peifu = $("#peifu"+i_data); var O_jieguo = $("#jieguo" + i_data); var touzhu_num = parseInt(O_touzhu.text()) ; O_touzhu.text( touzhu_num - 1); var touzhu_num = parseInt(O_touzhu.text()); var peifu_num = (touzhu_num * pei_lv) * 1.5 ; O_peifu.text (peifu_num) shezhiOK(parseInt(i_data),peifu_num); }) //设置结果集 function shezhiOK(weizhi,zhi){ all_ok[weizhi] = zhi; var t_max = 0; var t_suoyin = 0; for (x in all_ok) { var t_var = all_ok[x]; if (t_var >= t_max) { t_max = t_var; t_suoyin = x; } } shezhijieguo(t_suoyin,t_max); } //设置开奖结果 function shezhijieguo(leixing,gao_a){ switch (leixing){ case "1": case "2": case "3": case "4": case "6": case "7": case "8": case "9": kai.text(leixing); gao.text(gao_a); break; case "0": case "5": kai.text("半点"); gao.text(gao_a); break; case "10": kai.text("单"); gao.text(gao_a); break; case "11": kai.text("双"); gao.text(gao_a); break; case "12": kai.text("大单"); gao.text(gao_a); break; case "13": kai.text("大双"); gao.text(gao_a); break; case "14": kai.text("大"); gao.text(gao_a); break; case "15": kai.text("小"); gao.text(gao_a); break; } }
关键字词:javascript##