html+css3+jQuery双色球随机选号特效
工具/原料
adobe dreamweaver
方法/步骤
1
新建html文档。
2
书写hmtl代码。
红球区至少选择6个球 选号 遗漏 01 0 02 2 03 6 04 2 05 1 06 0 07 5 08 3 09 0 10 0 11 9 12 7 13 0 14 3 15 7 16 4 17 4 18 8 19 1 20 2 21 1 22 3 23 1 24 3 25 0 26 2 27 3 28 5 29 2 30 4 31 10 32 12 33 1 6#xe627; 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 #xe62e;机选红球 清空 蓝球区至少选择1个球 01 28 02 5 03 48 04 29 05 56 06 9 07 4 08 0 09 22 10 3 11 2 12 1 13 25 14 13 15 37 16 12 全选 1#xe627; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #xe62e;机选蓝球 清空 您选了0个红球,0个蓝球,共0注,0元 #xe76c;确认选号#xe76c; 清空选号 在线过滤 单式 17 18 19 20 27 28 + 08 [1注,2元] 修改 删除-- 导入方案保存方案对比历史开奖 机选1注 机选5注 机选10注 清空列表 您选了 2 注, 倍投 倍,共 4 元 
3
书写css代码。
* { margin: 0; padding: 0; -webkit-text-stroke-width: 0px; -moz-text-stroke-width: 0px; -o-text-stroke-width: 0px; -ms-text-stroke-width: 0px; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -o-box-sizing: border-box; -ms-box-sizing: border-box; }body { font-style: normal; font-family: \5FAE\8F6F\96C5\9ED1, 'Tahoma', 'Arial', 'Helvetica', 'sans-serif'; background-color: #FFF; font-size: 12px; color: #000; }a { color: #000; font-size: 12px; text-decoration: none; }input, select, textarea { vertical-align: middle; width: auto; outline: none; border: 0; }select { appearance: normal; -webkit-appearance: none; -moz-appearance: none; }img { vertical-align: middle; border: 0; outline: none; }div, p, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6 { display: block; width: auto; height: auto; }table { width: 100%; border-collapse: separate; border-spacing: 0px; border: 0; }.ssq_area { clear: both; width: 800px; overflow: hidden; margin: 0 auto; margin-top: 50px; padding: 20px; }.select_ball_area { clear: both; width: 100%; }.redball_area { float: left; width: 480px; }.redball_rule { clear: both; width: 100%; height: 30px; line-height: 30px; overflow: hidden; font-size: 14px; color: #000; text-align: center; margin-bottom: 10px; }.redball_rule strong { font-size: 15px; color: red; margin-right: 5px; }.redball_selected_area { clear: both; width: 100%; overflow: hidden; padding-left: 40px; position: relative; }.redball_selected_area dt { float: left; width: 50px; height: 50px; overflow: hidden; position: absolute; z-index: 1; top: 0px; left: 0px; }.redball_selected_area dt p { clear: both; width: 30px; height: 20px; line-height: 18px; overflow: hidden; font-size: 14px; color: #000; background-color: #ccc; margin: 5px 0px; text-align: center; }.redball_selected_area dt span { clear: both; width: 30px; overflow: hidden; font-size: 14px; color: #000; text-align: center; }.redball_selected_area dd { float: left; width: 40px; height: 50px; overflow: hidden; margin-bottom: 15px; text-align: center; }.redball_selected_area dd p { clear: both; width: 30px; height: 30px; line-height: 28px; overflow: hidden; border: 1px solid #333; border-radius: 20px; background-color: #eee; font-size: 16px; color: #333; font-weight: bold; margin: 0 auto; text-align: center; cursor: pointer; }.redball_selected_area dd p.active1 { background-color: red; color: #fff; }.redball_selected_area dd span { clear: both; width: 100%; overflow: hidden; font-size: 14px; color: #ccc; text-align: center; }.blueball_area { float: left; width: 240px; margin-left: 20px; }.blueball_rule { clear: both; width: 100%; height: 30px; line-height: 30px; overflow: hidden; font-size: 14px; color: #000; text-align: center; margin-bottom: 10px; }.blueball_rule strong { font-size: 15px; color: blue; margin-right: 5px; }.blueball_area ul { clear: both; width: 100%; overflow: hidden; }.blueball_area ul li { float: left; width: 40px; height: 50px; overflow: hidden; margin-bottom: 15px; text-align: center; }.blueball_area ul li p { display: block; clear: both; width: 30px; height: 30px; line-height: 28px; overflow: hidden; border: 1px solid #333; border-radius: 20px; background-color: #eee; font-size: 16px; color: #333; font-weight: bold; margin: 0 auto; text-align: center; cursor: pointer; }.blueball_area ul li p.active2 { background-color: blue; color: #fff; }.blueball_area ul li span { clear: both; width: 100%; overflow: hidden; font-size: 14px; color: #ccc; text-align: center; }.blueball_area ul li.selectall_box { float: left; width: 40px; height: 25px; line-height: 23px; overflow: hidden; border: 1px solid #ccc; background-color: #eee; font-size: 14px; color: #000; margin-top: 5px; margin-left: 10px; cursor: pointer; }.blueball_area ul li.selectall_box:hover { color: red; }.machine_redselected_area { clear: both; width: 100%; }.machine_redselected_area dl { float: left; width: 45px; position: relative; }.machine_redselected_area dl dt { clear: both; width: 100%; height: 25px; border: 1px solid #000; padding: 2px; }.machine_redselected_area dl dt em { float: left; width: 55%; height: 21px; line-height: 21px; overflow: hidden; font-size: 14px; color: #000; text-align: center; font-style: normal; }.machine_redselected_area dl dt span { float: left; width: 45%; height: 21px; line-height: 25px; overflow: hidden; font-size: 12px; color: #000; text-align: center; cursor: pointer; }.machine_redselected_area dl dd { display: none; clear: both; width: 100%; border: 1px solid #000; background-color: #fff; position: absolute; z-index: 10; top: 25px; left: 0px; }.machine_redselected_area dl dd p { clear: both; width: 100%; height: 18px; line-height: 18px; overflow: hidden; font-size: 14px; color: #000; text-indent: 8px; }.machine_redselected_area dl dd p:hover { background-color: #09c; }.machine_selectedred { float: left; width: 80px; height: 25px; line-height: 23px; overflow: hidden; border: 1px solid #000; background-color: #eee; margin-left: 20px; font-size: 14px; color: red; padding-right: 3px; cursor: pointer; }.machine_selectedred span { float: left; width: 18px; height: 23px; line-height: 25px; overflow: hidden; font-size: 18px; color: red; text-align: center; }.machine_redselected_area strong { float: left; width: 80px; height: 25px; line-height: 25px; overflow: hidden; font-size: 14px; color: blue; font-weight: 400; margin-left: 10px; cursor: pointer; }.machine_redselected_area strong:hover { color: red; }.machine_blueselected_area { clear: both; width: 100%; }.machine_blueselected_area dl { float: left; width: 45px; position: relative; }.machine_blueselected_area dl dt { clear: both; width: 100%; height: 25px; border: 1px solid #000; padding: 2px; }.machine_blueselected_area dl dt em { float: left; width: 55%; height: 21px; line-height: 21px; overflow: hidden; font-size: 14px; color: #000; text-align: center; font-style: normal; }
4
书写并添加js代码。
var rball_nums=0;var bball_nums=0;$("#redBall dd p").click(function(){$(this).toggleClass("active1");ballNums()});$("#blueBall li p").click(function(){$(this).toggleClass("active2");ballNums()});var select_all=true;$("#selectallBox").click(function(){if(select_all){$("#blueBall li p").addClass("active2");$(this).text("全清");select_all=false}else{$(".active2").removeClass("active2");$(this).text("全选");select_all=true}ballNums()});function ballNums(){rball_nums=$(".active1").length;bball_nums=$(".active2").length;var ball_text="您选了"+rball_nums+"个红球,"+bball_nums+"个蓝球,共0注,0元";$("#confirmBallnums").text(ball_text)}$("#machineRBnums dt").click(function(){$(this).css("border-color","blue");$("#machineRBnums dd").toggle();$("#machineRBnums dd").css("border-color","blue")});$("#machineRBnums dd p").click(function(){var red_num=$(this).text();$("#machineRBnums dt em").text(red_num);$("#machineRBnums dd").hide()});$("#machineSelectedred").click(function(){arr_red=new Array();maxrnums=parseInt($("#machineRBnums dt em").text());redRand();ballNums()});function redRand(){$("#redBall dd p").removeClass("active1");var rrandom_integer=parseInt(Math.random()*33+1);if(rrandom_integer=6bball_nums!=0){red_text=$(".active1").text();redBallnums();blue_text=$(".active2").text();blueBallnums();$(".revise_area").remove();var str='单式 '+arr_r.sort().join(" ")+'+ '+arr_b.sort().join(" ")+" [1注,2元] 修改 删除";$("#endBallbox").prepend(str);$("#redBall dd p").removeClass("active1");$("#blueBall p").removeClass("active2");ballNums()}else{if(rball_nums=6bball_nums==0){var error="您选了("+rball_nums+"红 +"+0+"蓝),请至少再选"+1+"个蓝球";alert(error)}}});function redBallnums(){arr_r=new Array();var i=0;while(i单式 '+arr_red.sort().join(" ")+'+ '+arr_blue.sort().join(" ")+" [1注,2元] 修改 删除";$("#endBallbox").prepend(str)}$("#redBall dd p").removeClass("active1");$("#blueBall p").removeClass("active2")}$("#clearList").click(function(){$("#endBallbox").find("li").remove()});
5
代码整体结构。

6
查看效果。

END
注意事项
jquery.min.js是个js包,可以网上下载。
Comments
Post a Comment