我正在使用Stupid Fixed Header修复两个表的标题。为此,我使用以下脚本。如何在jQuery中做到这一点?
$(document).ready(function(){
$("#table1").fixedHeader({
height: 160,
adjustWidth: function(th){
if($.browser.msie){
return $(th).width()+10;
}
return $(th).width();
}
});
$("#table2").fixedHeader({
height: 160,
adjustWidth: function(th){
if($.browser.msie){
return $(th).width()+10;
}
return $(th).width();
}
});
})
现在的问题是,我写相同的代码两次。一次用于table1,然后用于table2。是否可以只写一次?
伟大的工作 – 2009-12-04 09:05:33