|
|
|
| Добрый вечер..
Эту штуку практически не знаю. Есть у меня скрипт, в общем-то понимаю, как работает. Не могу понять, почему в ИЕ не действует на все пункты с чекбоксами( То есть все ок, но первые 9 штук не реагируют
Помогите пожалуйста
вот такие функции
var csumma = 0;
jQuery(document).ready(function(){
jQuery('input[@type=checkbox], input[@type=radio]', '.calc').click(function(){
applyCalc();
}).parent().parent().hover(
function(){jQuery("td", this).addClass("tdover")},
function(){jQuery("td", this).removeClass("tdover")}
);
jQuery('tr', '.calc').map(function(){
jQuery("td:eq(0)", this).addClass("center");
});
});
function applyCalc(){
csumma = 0;
jQuery('input[@type=checkbox]', '.calc').map(function(){
jQuery(this).parent().parent().find("td").removeClass("checked");
if (jQuery(this).attr("checked")){
jQuery(this).parent().parent().find("td").addClass("checked");
csumma += (jQuery(this).parent().next().html())*1;
}
});
jQuery('input[@type=radio]', '.calc').map(function(){
jQuery(this).parent().parent().find("td").removeClass("checked");
if (jQuery(this).attr("checked")){
jQuery(this).parent().parent().find("td").addClass("checked");
csumma = jQuery(this).parent().next().html()*1*csumma;
}
});
csumma = parseInt(csumma*100)/100;
jQuery('#calcSumma').html(csumma);
}
|
В html :
<table class="calc" style="height: 839px;">
<tr>
<th colspan="4" style="text-align:left;">Заголовок</th>
</tr>
<tr>
<td>1</td>
<td>Название пункта1</td>
<td><input class="p" name="cost" type="checkbox" /></td>
<td class="cost">10000</td>
</tr>
<tr>
<td>2</td>
<td>Название пункта2</td>
<td><input class="p" name="cost" type="checkbox" /></td>
<td class="cost">15000</td>
</tr>
<!-- и т.д. -->
<tr>
<th colspan="4" style="text-align:left;">ИТОГО</th>
</tr>
<tr>
<td colspan="4" id="calcSumma" class="summa"> </td>
</tr>
</table>
|
| |
|
|
|
|
|
|
|
для: hobbit-killer
(06.05.2010 в 20:36)
| | То есть оно не работает, когда ячеек достаточно большое количество. Чем больше верхние-нижние педдинги в ячейках, тем меньше требуется ячеек, чтобыне пахало в самых верхних. Только в ИЕ | |
|
|
|