1
我有一个选择菜单,当单击一个选项时显示/隐藏“livetransopts”div。在Firefox,Chrome等工作正常,但在IE浏览器没有人能帮助我吗?隐藏/显示jQuery中不工作在IE
<select>
<option class="hidelivetrans" value="No">No - Don't transfer the call</option>
<option class="showlivetrans" value="Yes">Yes - Transfer the call</option>
</select>
</div>
</div>
<!--Live transfer yes/no field-->
<script type="text/javascript">
$(document).ready(function() {
$('.livetransopts').hide();
$(".showlivetrans").click(function(){
$(".livetransopts").show('slow');
});
$(".hidelivetrans").click(function(){
$(".livetransopts").hide('slow');
});
});
</script>
<!--live trans opts-->
<div class="livetransopts">
<!--content here-->
</div>
使用'this.value'是更有效,因为它不会导致另一个jQuery对象的创建正确的方法。另外,缓存'$('。livetransopts')' – 2010-08-22 08:06:44