我有一个脚本函数,允许图像在4个图像之间旋转。该功能在页面加载时有2秒的超时时间,然后等待8秒钟,然后再旋转到第二个(以及后面的图像)计时器和延迟问题
我需要做的是设置它,以便图像在加载后立即开始旋转然后在那之后有8秒的旋转间隔。
这里是一个jsfiddle
$(function(){
\t $('.fadein2 > :gt(0)').hide();
\t setTimeout(function() {
\t setInterval(function(){$('.fadein2 :first-child').fadeOut().next().fadeIn().end().appendTo('.fadein2');}, 8000);
\t }, 2000);
});
.fadein {
\t position:relative;
\t height:400px;
\t width:300px;
\t float: left;
\t padding: 5px;
}
.fadein > * {
\t position:absolute;
\t left:0;
\t top:0;
\t display:block;
\t padding: 5px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="col-md-3">
<a href="/ContractHome.html">
<div class="fadein" style="padding: 15px;">
<img src="http://www.view-restaurant.co.uk/uploads/1/1/9/4/11949146/2826626.jpg?902" alt="">
<img src="http://d.otcdn.com/imglib/hotelfotos/8/203/hotel-hamilton-island-reef-view-whitsunday-islands-hamilton-island-018.jpg" alt="">
<img src="http://www.view-restaurant.co.uk/uploads/1/1/9/4/11949146/2826626.jpg?902" alt="">
<img src="http://d.otcdn.com/imglib/hotelfotos/8/203/hotel-hamilton-island-reef-view-whitsunday-islands-hamilton-island-018.jpg" alt="">
</div>
</a>
<p class="hoverText" style="top: 100px;width: 100%;">Contract</p>
</div>
所以哪来的问题呢? – lukaleli
Yeahhh ...我也在努力在这里看到问题。你需要定义“即将”的含义。 –
小提琴什么都不做。 – trincot