我有这个 JQuery 来显示/隐藏在 IE9 中不起作用的行,它对时间非常敏感,我完全不知道如何修复它。我尝试为 IE8 添加一个元标记,使其工作,但完全搞砸了格式。我不确定它在 IE8 中的本机功能。它确实在 Firefox 和 Chrome 中起作用。
function showNext(opt) {
takeAway();
var optMap={
"Picked Up":"#pickedup",
"Bus to alternate":"#altad2,#altad1",
"Walk to alternate":"#altad2,#altad1",
};
$(optMap[opt]).css("display","") ;
}
函数在这里被调用
<tr class="~[evenoddrow]">
<td class="bold">In the event of early dismissal I would like my child to:</td><td id="Emergclose_Action">~([01]Emergclose_Action)</td><td class="gwCen"></td>
<td><select name="eReg|Emergclose_Action" id="eReg|Emergclose_Action" onChange="showNext(value);">
<option></option><option value="Walk home as normal">Walk home as normal</option><option value="Ride the bus as normal">Ride the bus as normal</option>
<option value="Picked Up">Be picked up immediately after dismissal</option><option value="Bus to alternate">Ride the bus to an alternate address</option><option value="Walk to alternate">Walk to an alternate address</option>
</select>
</td>
</tr>
显示的行如下
<tr class="~[evenoddrow]" id="pickedup" style="display:none;">
<td class="bold">Name of the person that will be picking up your child:</td><td id="Emergclose_Who_Pickup">~([01]Emergclose_Who_Pickup)</td><td class="gwCen"></td>
<td><input type="text" name="eReg|Emergclose_Who_Pickup" id="eReg|Emergclose_Who_Pickup" value="" size="30" /><span class="gwExample">last, first</span></td>
</tr>
<tr class="~[evenoddrow]" id="altad1" style="display:none;">
<td class="bold"><span style="padding: 0 25px">I would like my child to go to the home of:</td></span><td id="Emergclose_Alt_Name">~([01]Emergclose_Alt_Name)</td><td class="gwCen"></td>
<td><input type="text" name="eReg|Emergclose_Alt_Name" id="eReg|Emergclose_Alt_Name" value="" size="30" /><span class="gwExample">last, first</span></td>
</tr>
<tr class="~[evenoddrow]" id="altad2" style="display:none;">
<td class="bold"><span style="padding: 0 25px">Address of Alternate Location:</td></span><td id="Emergclose_Alt_Address">~([01]Emergclose_Alt_Address)</td><td class="gwCen"></td>
<td><input type="text" name="eReg|Emergclose_Alt_Address" id="eReg|Emergclose_Alt_Address" value="" size="30" /><span class="gwExample">Street Address, City, State, Zip</span></td>
</tr>