【发布时间】:2015-08-14 16:48:13
【问题描述】:
我的想法是我有一个带有一些图像的 div(在水平线上),您只能看到 div 中的第一张图像。 目前有5张图片。 我想将图像从右向左移动,离开 div(和屏幕),在最后一张图像移动后,第一张图像将在前面(即 1 个整个循环) 要开始动画,请单击一个按钮。
现在的诀窍是,在每个奇数编号的图像上,动画都必须停止片刻。所以起始图像是 1,然后通过数字 2 并在 3 处停止几秒钟,然后通过数字 4 并在数字 5 处停止,之后图像再次继续到第一个并停止,直到再次单击开始按钮。
我希望能够相当容易地扩展图像数量。
到目前为止,我在 CSS / HTMl 中所拥有的是
<body>
<div id="container">
<div id="fotos">
<div class="image"><img src="afb_stuk/1.png"/></div>
<div class="image"><img src="afb_stuk/2.png"/></div>
<div class="image"><img src="afb_stuk/3.png"/></div>
<div style="clear:both"></div>
</div>
</div>
<div id="start">
<h2 class="text"></h2>
</div>
</body>
和css
body{
padding:0px;
margin:0px;
background-image:url(afb_stuk/background.jpg);
background-repeat:no-repeat;
background-size:cover;}
#container{
position:relative;
margin-left:50px;
margin-top:25px;
height:600px;
width:1250px;
border:solid thin red;
z-index:1;
/*overflow:hidden;*/}
#fotos{
position:relative;
height:80%;
width:12000px;}
.image{
height:600px;
width:1250px;
float: left;
.image img{
height:600px;
width:auto;}
#start{
position:relative;
margin:auto;
margin-top:-10px;
height:10px;
width:60px;
border-radius: 25px;
border: 2px solid #8AC007;
padding: 20px; }
.text{
margin-top:-10px;}
【问题讨论】:
-
你有你的代码的 jsfiddle 包括你当前的 jquery 吗?
-
不,我没有,我还没有任何 Jquery 代码。尝试了一些东西,但仍在学习它是如何工作的,并且遇到了很多问题:(
标签: jquery css image jquery-animate move