Economist.com 如何实施其粘性标题? jQuery?

发布于 2024-10-06 07:31:53 字数 280 浏览 0 评论 0原文

如果您访问《经济学人》网站上的一篇文章。例如:

http://www.economist.com/node/17629757

当您向下滚动页面经过某个点(使用 PAGEDOWN 按钮或使用 DOWNARROW 键增量滚动),会出现红色粘性标题。

那是 jQuery 吗?

这是如何实施的?

If you go to an article on The Economist website. For example:

http://www.economist.com/node/17629757

When you scroll down the page past a certain point (either with the PAGEDOWN button or by incrementally scrolling with the DOWNARROW key), a red sticky header appears.

Is that jQuery?

How is that implemented?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

神妖 2024-10-13 07:31:54

通过 JavaScript 添加的内容只是 位置:固定。

The content, while added via JavaScript is just position: fixed.

回心转意 2024-10-13 07:31:54

《经济学人》使用 Apture,该服务包括粘性标题和页面上的一些其他功能。 (标头的 ID 为“aptureD”,所以我开始谷歌搜索。)如果您想要的只是那个确切的标头,您可以使用他们的服务。

The Economist uses Apture, a service which includes the sticky header and a few other features on the page. (The header has the ID "aptureD", so I started Googling.) If all you want is that exact header, you can just use their service.

我爱人 2024-10-13 07:31:54

您可以使用 Apture 或制作自定义粘性标题。查看示例

You can use the Apture or make a custom sticky header. Look at example.

春花秋月 2024-10-13 07:31:54

有两种方法可以实现这一点:position:fixedposition:absolute
第一个是非常基本的,你将无法获得任何滑动动画。第二个是您的示例中使用的。这是一个很好的 教程,包含演示来源

There are two ways to achieve that: position:fixed and position:absolute.
The first one is very basic and you won't be able to get any sliding animation. The second one is what used in your example. Here is a good tutorial with demo and a source.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文