可以通过 jQuery 实现 ul 和 li 的垂直滚动吗?
示例:http://www.net-a-porter.com/product/163606
到目前为止我的代码:
<style type="text/css">
li {float:left;height:50px}
</style>
<div style="height:100px">
<a href="#" class="top">up</a>
<ul>
<li>Product 1</li>
<li>Product 2</li>
<li>Product 3</li>
<li>Product 4</li>
<li>Product 5</li>
<li>Product 6</li>
</ul>
<a href="#" class="down">down</a>
</div>
Example : http://www.net-a-porter.com/product/163606
So far my code:
<style type="text/css">
li {float:left;height:50px}
</style>
<div style="height:100px">
<a href="#" class="top">up</a>
<ul>
<li>Product 1</li>
<li>Product 2</li>
<li>Product 3</li>
<li>Product 4</li>
<li>Product 5</li>
<li>Product 6</li>
</ul>
<a href="#" class="down">down</a>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将内部 UL 发布到带有 Overflow:hidden 的 div 内,并上下移动内部 UL 的位置,从而创建一种滚动效果。
You could post the inner UL inside a div with overflow:hidden, and move the inside UL's position up and down, and by that creating a sort of a scroll effect.
@沙伊。你知道为什么这不起作用吗?我正在查明是否有超过三个 LI 超过显示箭头。否则不显示箭头:
更新 - 解决方案:
@Shai. Do you know why this is not working. I am finding out if there is more than three LI than show arrows. Otherwise do not show arrows:
UPDATED - Solution: