考虑,你只有两个overlay
容器grey
和white
。 如果您想在second
点击two swoops
,您可能需要替换其transition-delay
属性。
$(document).ready(function() {
$('#clickThis').click(function(e) {
e.preventDefault();
if ($('.overlay.grey').hasClass('extend') === true) {
$('.overlay.grey').css('transition-delay', '0.3s');
$('.overlay.white').css('transition-delay', '0.1s');
} else {
$('.overlay.grey').css('transition-delay', '0.1s');
$('.overlay.white').css('transition-delay', '0.3s');
}
$('.overlay').toggleClass('extend');
});
});
这是因为你已经点击#clickThis
元素时,white
容器是当前container
是最后一场演出,因为你已经在你的CSS给定延迟(例如0.3s
)组成。
因此,在second
点击,将grey
容器已经采取影响,但其隐藏在white
容器(看看Z-index属性)背后
希望这有助于为你的情况