使用floatThead plugin时,除非我使用浏览器的“最大化/恢复向下”按钮,否则一切看起来都不错。当我最大化时,它看起来很好;但是,当我“恢复”时,表格不会缩放到正确的大小,最后一列被部分隐藏。然后,如果您稍微单击并拖动浏览器,则表格将调整为适当的大小。
Here's a fiddle that shows this behavior。我在IE10,Chrome和FireFox中看到了这种行为。
var $table = $('.myTable');
$table.floatThead({
//debounceResizeMs: 300,
scrollContainer: function ($table) {
return $table.closest('.wrapper');
}
});
我尝试将debounceResizeMs
属性设置为 slow 延迟调整大小,但这并没有解决此问题。 I know the plugin's developer is aware of the issue,但这似乎是一个流行的插件,所以我猜其他人遇到过这个问题,希望找到一个解决方案,因为我没有想法。
由于
更新
此行为似乎与Windows计算机隔离。 floatThead开发人员正在进行修复。对于Mac用户,这是我在使用Chrome的Windows 7上看到的内容
答案 0 :(得分:1)
将以下内容添加到$(window).resize()事件
中$('#id').floatThead('reflow')
这适合我...
答案 1 :(得分:0)
设置 'autoReflow' 为 true 如下图
var $table = $('.myTable');
$table.floatThead({
//debounceResizeMs: 300,
position: 'auto',
autoReflow: true,
scrollContainer: function ($table) {
return $table.closest('.wrapper');
}
});