Firefox与IE兼容的行隐藏与显示的实现

 function showPages(){
   
   var startIndex = (currentPageIndex - 1) * pageSize;
   var endIndex = currentPageIndex * pageSize;
   //判断是否为火狐浏览器
   var ff = !(document.all) ;

   var table = $("v_details");
   for(i=0;i< totalCount; i++){
   	  //隐藏行,IE与火狐均可用
  	  table.rows[i].style.display="none";
	  
	  if( i < endIndex && i >= startIndex){
	  if(ff){
	  		//火狐兼容显示行
	    	table.rows[i].style.display="table-row";
	    }else{
	    	//IE兼容显示行
	    	table.rows[i].style.display="block";
	    }
	  }
   }

   $("currentPage").innerHTML = currentPageIndex;
   $("totalPages").innerHTML = totalPages;
   checkPagesDisabled();  	 
 }
 

你可能感兴趣的:(浏览器,IE,firefox)