该问题主要产生在ie8下对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值来判断当前行是否是隐藏状态
详细代码如下:

Js代码 
  1. var hideCount=0;   
  2. jQuery("#dataList tr").each(function(){   
  3.      var curTR=jQuery(this);   
  4.      var display=curTR.css("display");   
  5.      if(display=="none"){   
  6.         hideCount=hideCount+1;   
  7.      }   
  8. });  
var hideCount=0;
jQuery("#dataList tr").each(function(){
     var curTR=jQuery(this);
     var display=curTR.css("display");
     if(display=="none"){
        hideCount=hideCount+1;
     }
});

 上面方法 ie6,ie7,ie8,ff测试通过

 http://hikin.iteye.com/blog/627198

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2022-02-16
  • 2021-07-22
  • 2021-05-26
  • 2022-12-23
  • 2021-08-11
  • 2021-06-15
猜你喜欢
  • 2022-12-23
  • 2022-03-03
  • 2022-12-23
  • 2022-02-21
  • 2022-01-28
  • 2021-05-19
  • 2022-12-23
相关资源
相似解决方案