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