$('.DrpDwn option').livequery(function () {
$(this).each(function () {
$(this).addClass("DrpDwnItm");
});
});
$(function () {
// updates Contract Id dropdown upon selection
$(".DrpDwnItm").live('mouseover', function () {
alert("text");
});
});
我试过了:
$(function () {
// updates Contract Id dropdown upon selection
$(".DrpDwnItm").live('hover', function () {
alert("text");
});
});
这在FireFox中运行良好。但IE8不起作用。我正在尝试为每个选项标签添加一个类,其中select标签有一个名为DrpDwn的类。任何人都可以提供任何想法吗?感谢
HTML MarkUp。
<table id="wrkshtpar" >
<tr>
<th colspan="3">REMAINING STOCKPILE
</th>
</tr>
<tr>
<th>
Qty
</th>
<th>
Rem %
</th>
<th>
StkPl %
</th>
</tr>
<tr>
<td class="hidden">
<input id="WorkSheetDetails_0__MyWorkSheetPartials_0__SeqID" name="WorkSheetDetails[0].MyWorkSheetPartials[0].SeqID" type="hidden" value="3" />
<input id="WorkSheetDetails_0__MyWorkSheetPartials_0__ComponetLabel" name="WorkSheetDetails[0].MyWorkSheetPartials[0].ComponetLabel" type="hidden" value="REMAINING STOCKPILE" />
<input id="WorkSheetDetails_0__MyWorkSheetPartials_0__ComponetId" name="WorkSheetDetails[0].MyWorkSheetPartials[0].ComponetId" type="hidden" value="0" />
</td>
<td>
<label for="WorkSheetDetails_0__MyWorkSheetPartials_0__PartialQty">0</label>
</td>
<td>
<input id="WorkSheetDetails_0__MyWorkSheetPartials_0__RemainingPercentage" name="WorkSheetDetails[0].MyWorkSheetPartials[0].RemainingPercentage" type="hidden" value="0.50" />
<label for="WorkSheetDetails_0__MyWorkSheetPartials_0__RemainingPercentage">50.00 %</label>
</td>
<td>
<input id="WorkSheetDetails_0__MyWorkSheetPartials_0__StkPileSeqId" name="WorkSheetDetails[0].MyWorkSheetPartials[0].StkPileSeqId" type="hidden" value="1" />
</td>
</tr>
<tr>
<td class="hidden">
<input id="WorkSheetDetails_1__MyWorkSheetPartials_0__SeqID" name="WorkSheetDetails[1].MyWorkSheetPartials[0].SeqID" type="hidden" value="4" />
<input id="WorkSheetDetails_1__MyWorkSheetPartials_0__ComponetLabel" name="WorkSheetDetails[1].MyWorkSheetPartials[0].ComponetLabel" type="hidden" value="REMAINING STOCKPILE" />
<input id="WorkSheetDetails_1__MyWorkSheetPartials_0__ComponetId" name="WorkSheetDetails[1].MyWorkSheetPartials[0].ComponetId" type="hidden" value="0" />
</td>
<td>
<input id="WorkSheetDetails_1__MyWorkSheetPartials_0__PartialQty" name="WorkSheetDetails[1].MyWorkSheetPartials[0].PartialQty" size="5" type="text" value="400" />
</td>
<td>
<input id="WorkSheetDetails_1__MyWorkSheetPartials_0__RemainingPercentage" name="WorkSheetDetails[1].MyWorkSheetPartials[0].RemainingPercentage" type="hidden" value="0.50" />
<label for="WorkSheetDetails_1__MyWorkSheetPartials_0__RemainingPercentage">50.00 %</label>
</td>
<td>
<select class="DrpDwn" id="WorkSheetDetails_1__MyWorkSheetPartials_0__StkPileSeqId" name="WorkSheetDetails[1].MyWorkSheetPartials[0].StkPileSeqId"><option selected="selected" value="1">50.00 %</option>
<option value="-1">100.00 %</option>
</select> </td>
</tr>
<tr>
<td class="hidden">
<input id="WorkSheetDetails_2__MyWorkSheetPartials_0__SeqID" name="WorkSheetDetails[2].MyWorkSheetPartials[0].SeqID" type="hidden" value="5" />
<input id="WorkSheetDetails_2__MyWorkSheetPartials_0__ComponetLabel" name="WorkSheetDetails[2].MyWorkSheetPartials[0].ComponetLabel" type="hidden" value="REMAINING STOCKPILE" />
<input id="WorkSheetDetails_2__MyWorkSheetPartials_0__ComponetId" name="WorkSheetDetails[2].MyWorkSheetPartials[0].ComponetId" type="hidden" value="0" />
</td>
<td>
<input id="WorkSheetDetails_2__MyWorkSheetPartials_0__PartialQty" name="WorkSheetDetails[2].MyWorkSheetPartials[0].PartialQty" size="5" type="text" value="100" />
</td>
<td>
<input id="WorkSheetDetails_2__MyWorkSheetPartials_0__RemainingPercentage" name="WorkSheetDetails[2].MyWorkSheetPartials[0].RemainingPercentage" type="hidden" value="1" />
<label for="WorkSheetDetails_2__MyWorkSheetPartials_0__RemainingPercentage">100.00 %</label>
</td>
<td>
<select class="DrpDwn" id="WorkSheetDetails_2__MyWorkSheetPartials_0__StkPileSeqId" name="WorkSheetDetails[2].MyWorkSheetPartials[0].StkPileSeqId"><option value="1">50.00 %</option>
<option selected="selected" value="-1">100.00 %</option>
</select> </td>
</tr>
<tr>
<td class="hidden">
<input id="WorkSheetDetails_3__MyWorkSheetPartials_0__SeqID" name="WorkSheetDetails[3].MyWorkSheetPartials[0].SeqID" type="hidden" value="0" />
<input id="WorkSheetDetails_3__MyWorkSheetPartials_0__ComponetLabel" name="WorkSheetDetails[3].MyWorkSheetPartials[0].ComponetLabel" type="hidden" value="REMAINING STOCKPILE" />
<input id="WorkSheetDetails_3__MyWorkSheetPartials_0__ComponetId" name="WorkSheetDetails[3].MyWorkSheetPartials[0].ComponetId" type="hidden" value="0" />
</td>
<td>
<input id="WorkSheetDetails_3__MyWorkSheetPartials_0__PartialQty" name="WorkSheetDetails[3].MyWorkSheetPartials[0].PartialQty" size="5" type="text" value="0" />
</td>
<td>
<input id="WorkSheetDetails_3__MyWorkSheetPartials_0__RemainingPercentage" name="WorkSheetDetails[3].MyWorkSheetPartials[0].RemainingPercentage" type="hidden" value="0" />
<label for="WorkSheetDetails_3__MyWorkSheetPartials_0__RemainingPercentage">0.00 %</label>
</td>
<td>
<select class="DrpDwn" id="WorkSheetDetails_3__MyWorkSheetPartials_0__StkPileSeqId" name="WorkSheetDetails[3].MyWorkSheetPartials[0].StkPileSeqId"><option value="1">50.00 %</option>
<option value="-1">100.00 %</option>
</select> </td>
</tr>
</table>