IE 8の下で、jQuery:hidden関数のTR上のbugと解決方法

648 ワード

この問題は主にie 8の下でtrラベルを隠した後にその個数を統計した時に現れた公式の解釈である:There is an open ticket for this.It is interesting because IE says that the TR element still has a width > 0 even though it isn't displayed. If you check the TD of the hidden TR, it is hidden. 解決策は、行のcssスタイルでdisplay値を取得することによって、現在の行が非表示状態であるかどうかを判断する詳細コードは以下の通りである.
var hideCount=0;
jQuery("#dataList tr").each(function(){
     var curTR=jQuery(this);
     var display=curTR.css("display");
     if(display=="none"){
        hideCount=hideCount+1;
     }
});

上記の方法ie 6,ie 7,ie 8,ff試験に合格した