开发者

Issues with jQuery sliding table header

As a follow up to a question I asked recently, I'm having some problems.

Take a look at this fiddle: http://jsfiddle.net/Lzhf6/9/. If you scroll down the page and then scroll back up ve开发者_StackOverflow中文版ry quickly (using mouse wheel is best), the header gets stuck before it can reach its correct position. It's a bit awkward to explain without viewing the fiddle so please do take a look at that.

What I need is for the Javascript to detect when this has happened and then reset it automatically to the actual correct position.

Any help appreciated.


I tried resetting the css top

if (scrollY > headtop) {
    $("tr[name='headerrow']").children().offset({
        top: scrollY
    });
} else {
    $("tr[name='headerrow']").children().css('top', '');
}

please see: http://jsfiddle.net/eFNPG/2/

I tried your code on Chrome, the header stays on top. But when I tried it on Firefox 3.6 the header doesn't stay on top. (even the original code: http://jsfiddle.net/Lzhf6/9/)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜