jquery垂直滚动菜单(scrollTo?)
我想知道是否可以获得这样的菜单: http://www.pitgroup.nl/over -ons/ (在左侧的ons菜单上)但编写的代码较少。
我所拥有的是:
<div class="scrollmenu">
<ul class="scrollframe">
<li><a href="#">Tony Start - CEO</a></li>
<li><a href="#">John Connor - Art Director</a></li>
<li><a href="#">Samatha Carter - Designer</a></li>
<li><a href="#">John Smith - Web developer</a></li>
<li><a href="#">Matthew Smith - Web developer</a></li>
<li><a href="#">John Doe - Web developer</a></li>
<li><a href="#">Kim Lee - Web developer</a></li>
<li><a href="#">Jason Stone - PHP programmer</a></li>
<li><a href="#">Veronica Moore - SEO Specialist</a></li>
<li><a href="#">Mandy Ovanova - Marketing Manager</a></li>
</ul>
</div>
一点CSS:
.scrollmenu {width:428px;border-left:1px solid #e4e4e4;border-right:1px solid #e4e4e4;height:132px;overflow:hidden;}
.scrollmenu ul {list-style:none;padding:0px;margin:0px;}
.scrollmenu ul li {display:block;}
.scrollmenu ul li a {display:block;height:32px;border-bottom:1px solid #e4e4e4;line-height:32px;padding:0px 0px 0px 15px;text-transform:uppercase;color:#484848;background:#f4f4f4;}
.scrollmenu ul li a:hover, .scrollmenu ul li a.current {background:#e4e4e4;}
它是一个最简单的垂直列表,现在我希望它的行为就像给定的链接 http://www.pitgroup.nl/over-ons/。我花了几个小时寻找类似的东西,但我发现的只有下拉菜单或类似菜单的脚本,但行为不像在页面上那样。
有人可以帮忙吗,我应该在 jquery 文档中读什么来制作这样的东西。或者也许你们中的一些人已经有了这样的东西?
编辑:单击位置 - 您将看到整个列表正在向下或向上移动,这就是我需要的效果。
I was wondering if it is possible to get menu like this: http://www.pitgroup.nl/over-ons/ (over ons menu on the left) but writing less code.
What I have is:
<div class="scrollmenu">
<ul class="scrollframe">
<li><a href="#">Tony Start - CEO</a></li>
<li><a href="#">John Connor - Art Director</a></li>
<li><a href="#">Samatha Carter - Designer</a></li>
<li><a href="#">John Smith - Web developer</a></li>
<li><a href="#">Matthew Smith - Web developer</a></li>
<li><a href="#">John Doe - Web developer</a></li>
<li><a href="#">Kim Lee - Web developer</a></li>
<li><a href="#">Jason Stone - PHP programmer</a></li>
<li><a href="#">Veronica Moore - SEO Specialist</a></li>
<li><a href="#">Mandy Ovanova - Marketing Manager</a></li>
</ul>
</div>
bit of css:
.scrollmenu {width:428px;border-left:1px solid #e4e4e4;border-right:1px solid #e4e4e4;height:132px;overflow:hidden;}
.scrollmenu ul {list-style:none;padding:0px;margin:0px;}
.scrollmenu ul li {display:block;}
.scrollmenu ul li a {display:block;height:32px;border-bottom:1px solid #e4e4e4;line-height:32px;padding:0px 0px 0px 15px;text-transform:uppercase;color:#484848;background:#f4f4f4;}
.scrollmenu ul li a:hover, .scrollmenu ul li a.current {background:#e4e4e4;}
it's a simpliest vertical list and now I would like it to behave like in the given link http://www.pitgroup.nl/over-ons/. I was searching for something like this for few hours but only scripts that I found was drop downs or similar menus but not behaving like on the over-ons page.
Could anybody please help, what should I read in the jquery documentation to make something like this. Or maybe some of you guys already have something like this ?
edit: click on the positions - you will see that whole list is moving down or up and this is the effect I need.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这样可以吗?
演示: http://jsfiddle.net/XN6VL/2/
代码:
Is this OK?
Demo: http://jsfiddle.net/XN6VL/2/
Code:
您只需要一个调用 jQuery 中的 animate 函数的悬停事件处理程序。像这样的东西:
You'll just need a hover event handler that calls the animate function in jQuery. Something like this: