livequery 在 IE8 中不工作

发布于 2024-12-09 10:50:39 字数 6789 浏览 0 评论 0原文

$('.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不行。我试图向每个选项标签添加一个类,其中选择标签有一个名为 DrpDwn 的类。任何人都可以提供任何想法来解释为什么吗?感谢

HTML 标记。

    <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>
$('.DrpDwn option').livequery(function () {
            $(this).each(function () {
                $(this).addClass("DrpDwnItm");
            });
        });
$(function () {
        // updates Contract Id dropdown upon selection
        $(".DrpDwnItm").live('mouseover', function () {
            alert("text");
        });
    });

I've tried:

$(function () {
        // updates Contract Id dropdown upon selection
        $(".DrpDwnItm").live('hover', function () {
            alert("text");
        });
    });

This is working fine in FireFox. but does not work IE8. I'm trying to add a class to each option tag where the select tag has a class named DrpDwn. Can anyone provide any ideas has to why? Thanks

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文