0
我正在設計一個着陸頁,其中圖片形成一個網格。點擊一個按鈕後,圖片會逐漸消失並逐一返回,形成另一個矩形網格,以獲得有趣的效果。我怎樣才能讓它自動繞過點擊功能並自動加載圖片。換句話說,網格形成了MINUS用戶的輸入。 (沒有點擊我將刪除的按鈕)通過繞過點擊事件加載函數
$(".animate").on("click", function(){
//fading out the thumbnails with style
$("img").each(function(){
d = Math.random()*1000; //1ms to 1000ms delay
$(this).delay(d).animate({opacity: 0}, {
//while the thumbnails are fading out, we will use the step function to apply some transforms. variable n will give the current opacity in the animation.
step: function(n){
s = 1-n; //scale - will animate from 0 to 1
$(this).css("transform", "scale("+s+")");
},
duration: 1000,
})
}).promise().done(function(){
//after *promising* and *doing* the fadeout animation we will bring the images back
storm();