向上滑动“条”使用css3的水平菜单效果?
我想使用 js 或 css3 或两者创建一个非常具体的效果。
我想在容器 div 的顶部有一个水平栏,其中有一组顶级菜单项,即:
主类别 1 |主类别2 |主要类别 3
当您将鼠标悬停在其中一个类别上时,“主要类别”会滑出视图(或者根本不出现......它不需要过渡,但我会 然后,
子链接出现在其位置:
类别 2 子链接 1 | 类别 2 子链接 3 | 类别 2 子链接 4
所有这些都在一个高度不超过 20-30 像素的薄水平 div 菜单中
。我如何实现这一目标的示例?目的是让用户一次将注意力集中在一级菜单项上。我正在制作的整个网站尽可能最小化。
I want to create a very specific effect using either js or css3 or both.
I want to have a a horizontal bar at the top of my container div that has a set of top level menu items ie:
Main Category 1 | Main Category 2 | Main Category 3
When you hover over one of these categories, the "main categories" slides up out of view (or simply doesn't appear.. it doesn't need a transition, but I'd like one.
Then, the sublinks appear in its place:
Category 2 sublink 1 | Category 2 sublink 2 | Category 2 sublink 3 | Category 2 sublink 4
All of this in a thin horizontal div menu no more than maybe 20-30px tall.
Any examples of how I could achieve this? The intent is to keep the user's focus on one level of menu items at a time.. the whole website I'm making is as minimal.. visually.. as possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你会接受 jquery 答案吗? (jsfiddle原型:http://jsfiddle.net/xaEWy/26/)
html:
一些css (需要对其进行整形才能将此示例转换为水平菜单):
jquery 代码:
would you accept a jquery answer? (jsfiddle prototype: http://jsfiddle.net/xaEWy/26/)
the html:
some css (which needs to be shaped up to convert this example into a horizontal menu):
the jquery code: