0
我使用jQuery淡入轉場的4張圖片的輪播。旋轉木馬的第一張圖片在先前的動畫結束後不會平滑淡入。旋轉木馬中的第一張圖片的淡入淡出轉換中的錯誤
這裏是一個鏈接到網頁: https://rimildeyjsr.github.io/St.Anthony-Website/
如何解決這個問題?
HTML:
<div class="slideshow">
<img src="images/page-1-hero-image.jpg" alt="school's image" class="img-responsive page-one-pic mySlides">
<img src="images/Capture2.jpg" alt="school pic" class="img-responsive mySlides">
<img src="images/Capture.jpg" alt="school pic" class="img-responsive mySlides">
<img src="images/Capture3.jpg" alt="school pic" class="img-responsive mySlides">
</div>
的Javascript:
var imgs = $(".slideshow > img");
function carousel() {
imgs.hide();
imgs.each(function(index,element){
// Don't make the first one (index = 0) wait at all;
// make the second (index = 1) wait 3 seconds, the third
// (index = 2) wait 6 seconds, etc. And then fade in
$(element).delay(index * 3000).fadeIn(1000);
});
// Start the entire process again two seconds after the last image fades in
setTimeout(carousel,imgs.length*3000);
}
鏈接到github上庫:https://github.com/rimildeyjsr/St.Anthony-Website
http://lab.25sprout.com/fadeImg/看看。 – Manish
謝謝,它工作:) –