我很難在一個剛剛完成後讓另一個功能工作。我的代碼的前半部分起作用,但之後的功能不起作用。我究竟做錯了什麼?繼續執行一個功能
的HTML
<div id="feature">
<div id="open"></div>
</div>
的CSS
#feature {
position:relative;
width:100%;
height:450px;
}
#open {
position:relative;
width:100%;
height:200px;
background:red;
}
jQuery的
$('#open').click(function() {
$(this).animate({
height: 50
}, {
duration: 'slow'
}).css('overflow', 'visible'),
function() {
$('#open').animate({
height: 200
}, {
duration: 'slow'
})
};
// Animation complete.
});
一個JS提琴。
http://api.jquery.com/animate/ ** complete **:動畫完成後調用的函數。 – 2013-04-21 23:59:59