我正在尝试创建一个 jquery 滚动图像显示,类似于许多其他的图像显示,但我真的很难克服一个障碍。 我基本上想围绕这段代码创建一个父容器,这样浏览器窗口就不会滚动。我猜是某个视口(viewport)?我尝试过一百万种不同的东西。我的 CSS 不够好
这是 fiddle : http://jsfiddle.net/68unq/
谢谢!
最佳答案
为什么您的 HTML 中间有任意样式?无论如何,将它们从 HTML 中取出,放入 CSS 中,并为您的容器添加一个 ID。
jsFiddle:http://jsfiddle.net/68unq/2/
HTML:
<div id="container">
<div id="holder" >
<img src="http://placehold.it/290x27" class='img'>
<img src="http://placehold.it/257x65" class='img'>
<img src="http://placehold.it/270x27" class='img'>
<img src="http://placehold.it/257x120" class='img'>
</div>
<div>
CSS:
#container {
position: relative;
width:400px;
height:200px;
background-color:black;
overflow:scroll;
}
关于jquery - css父容器没有滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11183376/