滑动“下拉”导航 - 我用什么?我该如何实施? jQuery?
我是 Javascript 和 jQuery 的新手,但我正在学习。这是我想要完成的任务:
我有一行导航“下拉”选项卡,我想要为其设置动画。有些滑块将具有指向子页面的文本链接,有些则不会。选项卡的底部应该可以单击以转到主页。然后子页面,文本链接也应该是可点击的。
这是一个图形示例,应该可以理解我想做的事情: http://lionheart.net/downloads/nav-example.png
将鼠标悬停,会把它滑下来。 鼠标移开一秒钟后,应该会自动向上滑动。
我更希望它是一个上下滑动的 div。
这可以用 jQuery 或其他东西实现吗? 非常感谢您能给我的任何帮助!
I'm new to Javascript and jQuery, but I'm learning. Here is what I'd like to accomplish:
I have a row of navigation "pull-down" tabs that I'd like to animate. Some sliders will have text links to sub-pages and some will not. The bottom portion of the tab should be clickable to go to the main page. Then the sub-page, text links should also be clickable.
Here is a graphic example that should make sense of what I'd like to do:
http://lionheart.net/downloads/nav-example.png
Mouse over, would slide it down.
Mouse out, after a second, should auto-slide up.
I would prefer to have it be a div sliding up and down.
Is this possible with jQuery or something else?
Thanks so much for any help you can give me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它在 jquery 本身上运行良好。如果您使用jquery,我认为您可能在为jquery 分配id 时遇到问题。如果您使用 id,它只能工作一页。
请使用 jquery 中的类来使用所有页面。不要在 ID 中使用 #,而是使用 .在课堂上。
It is working fine on jquery itself. If you are using jquery i think you may have problem of assigning jquery with id. If you are using id, it worked only one page.
Please use the class in jquery for using all pages. Instead of # using in ID, use . in class.
由于您没有 jQuery 或 JS 经验,我建议从 Google 开始(例如 此查询)。您会发现很多热门内容(尝试第一个),其中提供了大量动态菜单,并包括现场演示和教程。
选择一个在视觉和功能上看起来都不错的,然后按照相应的教程进行操作。如果您遇到问题,请返回 SO 并提出更具体的问题。
Since you have no jQuery or JS experience, I would suggest starting from Google (for example with this query). You will find lots of hits (try the first one) which present lots of dynamic menus and include both live demos and tutorials.
Select one that looks about right visually and feature-wise, then follow the corresponding tute. If you have problems, come back to SO with more specific questions.
如果你不需要动画,你可以只用 CSS 来做下拉菜单,如果浏览器不支持,它们甚至会降级为简单的嵌套列表。一个示例位于 http://www.designmeme.com/tutorials/csspulldownmenus/。如果您有兴趣,我可以发布我使用的 CSS 和 HTML;就在下面评论吧。
If you didn't need the animation, you can do pull-down menus with CSS only, and they'll even degrade to simple nested lists if the browser doesn't support it. One example is at http://www.designmeme.com/tutorials/csspulldownmenus/. I can post the CSS and HTML I use if you're interested; just comment below.