计算各种值得js
// JavaScript Document $(function(){ var red_one_num = Number($(".red_one").text()); var red_two_num = Number($(".red_two").text()); var red_three_num =Number($(".red_three").text()); var red_four_num = Number($(".red_four").text()); var red_five_num = Number($(".red_five").text()); var red_six_num = Number($(".red_six").text()); var blue_num = Number($(".blue").text()); var red_one_txt = $(".red_one").text(); var red_two_txt = $(".red_two").text(); var red_three_txt = $(".red_three").text(); var red_four_txt = $(".red_four").text(); var red_five_txt = $(".red_five").text() var red_six_txt = $(".red_six").text(); var blue_txt = $(".blue").text(); //第一组胆:计算red_one+blue的值, var dan_one_num = red_one_num + blue_num; if((dan_one_num)>33){ var dan_one_num = (dan_one_num)-33; } var dan_one_a = dan_one_num + 1; var dan_one_b = dan_one_num - 1; //第二组胆: 红三位拆分的和+蓝球拆分的和 var red_three_a = Number(red_three_txt.charAt(0));//0 var red_three_b = Number(red_three_txt.charAt(1));//8 var blue_a = Number(blue_txt.charAt(0)); var blue_b = Number(blue_txt.charAt(1)); var dan_two_num = red_three_a + red_three_b + blue_a + blue_b; var dan_two_a = dan_two_num + 1; var dan_two_b = dan_two_num - 1; //第三组胆:红二位+蓝球 var dan_three_num = red_one_num + blue_num; if((dan_three_num)>33){ var dan_three_num = (dan_three_num)-33; } var dan_three_a = dan_three_num + 1; var dan_three_b = dan_three_num - 1; //第四组胆:红六位-红四位+1 var dan_four_num = red_six_num - red_four_num + 1; if((dan_four_num)>33){ var dan_four_num = (dan_four_num)-33; } var dan_four_a = dan_four_num + 1; var dan_four_b = dan_four_num - 1; //第五组胆:红六位-红五位+2 var dan_five_num = red_six_num - red_five_num + 2; if((dan_five_num)>33){ var dan_five_num = (dan_five_num)-33; } var dan_five_a = dan_five_num + 1; var dan_five_b = dan_five_num - 1; //第六位:红二位+红三位 var dan_six_num = red_two_num + red_three_num ; if((dan_six_num)>33){ var dan_six_num = (dan_six_num)-33; } var dan_six_a = dan_six_num + 1; var dan_six_b = dan_six_num - 1; //第七组胆:尾和+1 var wei_one = Number(red_one_txt.charAt(1)); var wei_two = Number(red_two_txt.charAt(1)); var wei_three = Number(red_three_txt.charAt(1)); var wei_four = Number(red_four_txt.charAt(1)); var wei_five = Number(red_five_txt.charAt(1)); var wei_six = Number(red_six_txt.charAt(1)); var dan_seven_num = wei_one + wei_two + wei_three + wei_four + wei_five + wei_six; if((dan_seven_num)>33){ var dan_seven_num = (dan_seven_num)-33; } var dan_seven_a = dan_seven_num + 1; var dan_seven_b = dan_seven_num - 1; //第八组胆:(红一位+红六位)/2,取整 var dan_eight_num = parseInt((red_one_num + red_six_num)/2); var dan_eight_a = dan_eight_num + 1; var dan_eight_b = dan_eight_num - 1; //第九组胆:33-(红一位+红二位) var dan_nine_num = Math.abs(33 - (red_one_num + red_two_num)); var dan_nine_a = dan_nine_num + 1; var dan_nine_b = dan_nine_num - 1; //说明:凡是以dan_开头的都是计算出来的值; });
html页面
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title> <link href="ddwh.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="JQuery/jquery-2.0.3.js"></script> <script type="text/javascript" src="table_ddwh01.js"></script> </head> <body> <table border="1"> <caption>大底围红</caption> <tr> <td rowspan="2" class="issue">期号</td> <td colspan="6" class="red">红球</td> <td rowspan="2">蓝球</td> <td colspan="33" class="weihong">围红</td> <td rowspan="2">验证</td> </tr> <tr> <td>一</td> <td>二</td> <td>三</td> <td>四</td> <td>五</td> <td>六</td> <td>01</td> <td>02</td> <td>03</td> <td>04</td> <td>05</td> <td>06</td> <td>07</td> <td>08</td> <td>09</td> <td>10</td> <td>11</td> <td>12</td> <td>13</td> <td>14</td> <td>15</td> <td>16</td> <td>17</td> <td>18</td> <td>19</td> <td>20</td> <td>21</td> <td>22</td> <td>23</td> <td>24</td> <td>25</td> <td>26</td> <td>27</td> <td>28</td> <td>29</td> <td>30</td> <td>31</td> <td>32</td> <td>33</td> </tr> <tr> <td class="issue">001</td> <td class="red_one">14</td> <td class="red_two">23</td> <td class="red_three">24</td> <td class="red_four">26</td> <td class="red_five">29</td> <td class="red_six">30</td> <td class="blue">03</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="issue">002</td> <td class="red_one">02</td> <td class="red_two">08</td> <td class="red_three">12</td> <td class="red_four">14</td> <td class="red_five">16</td> <td class="red_six">32</td> <td class="blue">16</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td class="issue">003</td> <td class="red_one"> </td> <td class="red_two"> </td> <td class="red_three"> </td> <td class="red_four"> </td> <td class="red_five"> </td> <td class="red_six"> </td> <td class="blue"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </body> </html>
我的想法是:使用001这一期的红球计算出来值,我要在002这一期的围红部分显示出来!!!
下边!我用一个模拟图效果图给大家做个演示(里边的数据是我随便写的)
我现在是没有一点想法了,我希望各位大神,不但给想法,最好也给实实在在的代码!!
小弟在此先谢过了!!!!!
$("#tableid").find("tr")[i].find("td")[j].innerText=value;