当用户滚动时将表标题保留在屏幕上
我有一个包含表格的 HTML 页面。 表标题最终会滚动到屏幕顶部,但我希望标题在顶部保持可见。
我想使用像 alaskaair.com 的“Fares Selected”小部件这样的方法。 当您滚动页面时,他们的小票价小部件仍然可见:alaskaair.com 小部件的屏幕截图。
请注意,就我而言,它看起来更像是这样的: 简单模型
I have an HTML page that contains a table. The table headers get eventually scrolled off the top of the screen, but I would like the headers to stay visible at the top.
I want to use a method like alaskaair.com's "Fares Selected" widget. Their little Fares widget stays visible as you scroll the page: Screenshot of alaskaair.com widget.
Note that in my case it would look more like this: Simple Mockup
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最近遇到了类似的情况(为通知创建收件箱样式的显示),经过一些谷歌搜索,我发现了这些:
我目前正在使用 (1),到目前为止我还没有遇到任何问题。 您可以在此处关注解决方案的讨论。
编辑
我刚刚重新阅读了您的问题,我想这并不是您想要的。 不过,也许对其他人有用。
I was in a similar situation recently (creating an inbox-style display for notifications), and after some googling, I came across these:
I'm presently using (1) and I haven't encountered any issues with it so far. You can follow the discussion of the solution here.
EDIT
I just re-read your question, and I guess this isn't exactly what you were looking for. Still, maybe it'll be useful to someone else.
我使用 xTableHeaderFixed 冻结我的标题:
http://cross-browser. com/x/lib/view.php?s=xTableHeaderFixed
I use xTableHeaderFixed to freeze my headers:
http://cross-browser.com/x/lib/view.php?s=xTableHeaderFixed