简体   繁体   English

滑动“下拉”导航-我该怎么用? 我该如何实施? jQuery的?

[英]Sliding “pull-down” navigation - what do I use? How do I implement? jQuery?

I'm new to Javascript and jQuery, but I'm learning. 我是Java和jQuery的新手,但我正在学习。 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 这是一个图形示例,应该可以理解我想做的事情: 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. 我希望它是一个上下滑动的div。

Is this possible with jQuery or something else? jQuery或其他方法有可能吗? Thanks so much for any help you can give me! 非常感谢您能给我的任何帮助!

It is working fine on jquery itself. 它在jquery本身上运行良好。 If you are using jquery i think you may have problem of assigning jquery with id. 如果您正在使用jquery,我认为您可能会在分配带有id的jquery时遇到问题。 If you are using id, it worked only one page. 如果您使用的是ID,则只能使用一页。

Please use the class in jquery for using all pages. 请使用jquery中的类来使用所有页面。 Instead of # using in ID, use . 代替#在ID中使用,而是使用。 in class. 在班上。

Since you have no jQuery or JS experience, I would suggest starting from Google (for example with this query ). 由于您没有jQuery或JS的经验,因此建议您从Google开始(例如,使用此查询 )。 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. 如果您有问题,请再提出一些更具体的问题。

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. 如果不需要动画,则只能使用CSS进行下拉菜单,如果浏览器不支持,它们甚至会降级为简单的嵌套列表。 One example is at http://www.designmeme.com/tutorials/csspulldownmenus/ . 一个示例在http://www.designmeme.com/tutorials/csspulldownmenus/上 I can post the CSS and HTML I use if you're interested; 如果您有兴趣,我可以发布使用的CSS和HTML; just comment below. 请在下面发表评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM