當我在addClass()函數之前使用delay()函數時,類circle1不會延遲一段時間。delay()函數不能在jQuery中使用addClass()函數
下面我的代碼給出......
CSS:
.but{display:block; width:40px; height:40px; background-color:#F00; position:absolute;}
.circle1{display:block; width:145px; height:145px; position:absolute; left:10px; bottom:0px; border-radius:50%; border:5px solid rgba(100%,0%,20%,0.7); background-image:url(New%20folder/1st.jpg); background-position:center; background-repeat:no-repeat; background-size:cover; transform:scale(0);}
.zoom{transform:scale(1); transition:All 0.4s ease;}
JQuery的:
$(document).ready(function() {
$(".but").click(function() {
$('.but').fadeOut(300);
$('.circle1').delay(1000);
$('.circle1').addClass("zoom");
});
});
提供HTML代碼,或創建一個小提琴PLS – 2015-02-23 07:29:06