jQuery .toggle() not working with TRs in IE

前端 未结 13 2511
暗喜
暗喜 2020-12-08 20:43

I am using jQuery\'s toggle() to show/hide table rows. It works fine in FireFox but does not work in IE 8.

.show()/.hide() work fine though

13条回答
  •  一生所求
    2020-12-08 21:13

    $(document).ready(function() {  
        $(".readOnlyRow").hide();  
        $("#readOnlyRowsToggle").click(function() {  
            $(".readOnlyRow").toggle($('.readOnlyRow').css('display') == 'none');  
        });  
    });
    

    There is a jQuery bug that IE8 causes everything to evaluate to true. Try above

提交回复
热议问题