Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个代码:
<div class="project"> <div class="main"> Here are many images </div> </div>
div.project的width就是body的宽度,div.main的宽度是里面所有图片的宽度之和,比body宽很多。图像使用 float:left。
我如何使它(使用可拖动或其他东西)可以向右/向左滚动以查看所有图像?
overflow: scroll在您的课程主上使用
overflow: scroll
您必须有一个名为 window 的外部 div 或围绕您的内容的东西。那个窗口必须有overflow: hidden它。然后,您可以使用 jquery 在按下按钮时增加/减少内容 div 的边距以描绘滚动。
overflow: hidden