0
我想使用css动画向上滑动一些div。它向上滑动,但问题在于它不是连续的,就像第一个div会从最后一个div结尾处开始。如何在循环中连续滑动这些div
:: HTML ::
<div id="image_slider_right">
<div id="sliderup" >
<figure >
<div class="img_up" >
<div class="divimgslideup_txt" >
<strong>Nullam mauris velit</strong>
<p>tincidunt sit amet lectus non, iaculis interdum lectus. Fusce aliquam vitae magna...<a href="">details </a></p>
</div>
</div>
<div class="img_up">
<div class="divimgslideup_txt">
<strong>Interdum et malesuada </strong>
<p>Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque <a href="">details </a> </p>
</div>
</div>
<div class="img_up">
<div class="divimgslideup_txt">
<strong>vitae ullamcorper</strong>
<p> Vivamus facilisis quam eleifend, mollis dolor id, faucibus risus...<a href="">details </a> </p>
</div>
</div>
<div class="img_up">
<div class="divimgslideup_txt">
<strong>Sed nec porttitor</strong>
<p>Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque <a href="">details </a> </p>
</div>
</div>
<div class="img_up">
<div class="divimgslideup_txt">
<strong>Great Location</strong>
<p>Tucked away from the Dallas hustle, relax and know that everything you need is only minutes away </p>
</div>
</div>
</figure>
:: CSS ::
#image_slider_right
{ width:440px; float:left; position:relative; height:380px; margin-top:10px;margin-bottom:10px;}
div#sliderup { overflow: hidden; position:relative;height:100%; margin-left:10px; width:98%;}
div#sliderup figure .img_up { width: 98%;height:100%; float: left; margin-bottom:10px; position:relative; min-width:270px;}
div#sliderup figure
{ position: relative; width: 98%; margin: 0; text-align: left; animation: 20s mymove infinite; }
.divimgslideup_txt
{ float:left; width:99%; background:#E0DBD5; margin-left:5px; position:relative;font-size:13px; }
/* Chrome, Safari, Opera */
@-webkit-keyframes mymove {
0% { top: 0%; }
20% { top: -0%; }
25% { top: -20%; }
45% { top: -25%; }
50% { top: -45%; }
70% { top: -50%; }
75% { top: -70%; }
90% { top: -75%; }
100% { top: -100%; }
}
/* Standard syntax */
@keyframes mymove {
0% { top: 0%; }
20% { top: -0%; }
25% { top: -20%; }
45% { top: -25%; }
50% { top: -45%; }
70% { top: -50%; }
75% { top: -70%; }
90% { top: -75%; }
100% { top: -100%; }
}
如何解决?
你可以坚持的CSS动画状态动画填充模式:前锋;但是你无限循环,所以当它完成并重新开始时,它会回到最高点0%。 – ajmajmajma