0
在$('。transparent-close')中調用的事件click(function(){...});似乎沒有工作。這可能是因爲它在另一個.click()事件中?jQuery .click().animate()不起作用
$('#featured-top').click(function(){
$(this).animate({'top':'-318px'}, 600, 'easeOutBounce');
$('#featured-top-container').animate({'margin':'260px 0 0 117px'}, 600, 'easeOutBounce');
$('#wrap').animate({'margin-top':'365px'}, 600, 'easeOutBounce');
//Add transparent background for click out
$(document.body).append('<div class="transparent-close"></div>');
$('.transparent-close').click(function(){
$('#featured-top').animate({'top':'-318px'}, 600, 'easeOutBounce');
$('#featured-top-container').animate({'margin':'260px 0 0 117px'}, 600, 'easeOutBounce');
$('#wrap').animate({'margin-top':'365px'}, 600, 'easeOutBounce');
$(this).remove();
});
});
你是否通過調試器運行它? –
是的。沒有錯誤,但它不觸發$('。transparent-close')中的事件。click(function(){...}); – user1556408