答案 0 :(得分:1)
为每个需要鼠标悬停的元素添加一个类,然后为每个元素调用hover ..
样品,
count=0;
$("#requestsTable").dataTable({
"bFilter" :false,
"bAutoWidth" :false,
"aaData" : requestData,//whatever data u want to populate the table with
"fnRowCallback" : processRow
});
function processRow(nRow, aData, iDisplayIndex, iDisplayIndexFull){
if(count==1){ //hide every other row, link row
count=0;
$(nRow).addClass("hidden");
return nRow;
}
count=1;
//add hover functions for normal rows
$(nRow).hover(function(){
$( this ).next().show();
},function(){
$( this ).next().hide();
});
return nRow;
}
为隐藏的类添加样式
.hidden{
display: none;
}