如何使用jquery在页面顶部隐藏下拉菜单?

发布于 2024-08-08 23:07:31 字数 216 浏览 3 评论 0原文

我以前见过这样做的,但我不确定如何做。

当我的页面加载时,我希望在页面顶部下拉隐藏部分(高度大约为 100 像素)。理想情况下,我希望它也将整个页面向下移动(而不是出现在页面顶部)。秘密区域的右上角应该有一个“关闭”按钮,单击该按钮会导致实际页面向上滑动并覆盖部分。

我知道这个有一个名字,但我不确定它是什么。我假设它与 jquery 相关。

有人能指出我正确的方向吗?

I've seen this done before, but I'm not sure how.

When my page loads, I want a hidden section to drop down at the top of the page (probably around 100 pixels in height). Ideally, I'd like it to shift the entire page down as well (as opposed to appearing on top of the page). At the top corner of the secret area should be a 'Close' button, which when clicked causes the actual page to slide up and cover section.

I know there's a name for this, but I'm not sure what it is. I'm assuming it's jquery-related.

Can anyone point me in the right direction?

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

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

发布评论

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

评论(3

你是暖光i 2024-08-15 23:07:31

查找 jquery show,它应该可以正常工作: http://docs.jquery.com/Effects/show

<div id="hiddenMenu" style="display:none"> bla bla bla </div>

<a href="#" onclick="$('hiddenMenu').show('slow'); return false;">show the hidden menu</a>

Lookup jquery show, it should work fine : http://docs.jquery.com/Effects/show

<div id="hiddenMenu" style="display:none"> bla bla bla </div>

<a href="#" onclick="$('hiddenMenu').show('slow'); return false;">show the hidden menu</a>
最美不过初阳 2024-08-15 23:07:31

StackOverflow 有它,它基本上是一个

,出现在开始 标记之后。当您需要时,只需适当地设计即可。

StackOverflow has it, and it's basically a <div> that appears right after the opening <body> tag. Simply style appropriately when you need to.

很酷又爱笑 2024-08-15 23:07:31

嗯,有一个名为 Dialog 的 UI 插件,我经常使用它。虽然它是一个弹出窗口,但即使用户在页面上向下滚动,它也会显示。

Well, there is a UI plugin called Dialog that I use alot. It is a pop-over though, but will show even if the user is scrolled down on the page.

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