【问题标题】:how to freez header in a table in html [duplicate]如何在html中冻结表中的标题[重复]
【发布时间】:2013-12-05 18:21:13
【问题描述】:

在这里,我有一张桌子,我想在滚动时修复该标题

JS

<script>
$('#scroll').scroll(function(){
if ($('#scroll').scrollTop() > 10){
    $("thead").css({
            position: 'fixed',
            top: '68px'
        });
}else{
    $('thead').css({
        position: 'static'
    });
}
});
</script>

这是完美的工作,但设计正在改变。

LIVE DEMO - http://testing.twomini.com/

Fiddle

谁能帮帮我。

提前致谢。

【问题讨论】:

  • 不要在您将第一个问题放到网站上几小时后发布相同的问题。就此而言,永远不要发布同样的问题。你只是在浪费人们的时间。

标签: javascript jquery html css


【解决方案1】:

将位置更改为“静态”

$("thead").css({
    position: 'static',
    top: '68px'
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-24
    • 2021-06-26
    • 2019-02-04
    • 2019-12-09
    • 1970-01-01
    • 2018-05-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多