0
if($('.click').one('click')){
$('.click').click(function(){
$('.mainContent').animate(
{"height":"+=620px"},
800,
'easeInBack');
$('.eneButton').animate(
{ "top":"+=310px"},
1500,
'easeInOutExpo');
$('.eneButton').animate(
{"left":"-=310px"},
1500,
'easeInOutExpo')
$('.giardButton').animate(
{"top":"+=620px"},
2000,
'easeInOutExpo')
$('.giardButton').animate(
{"left":"-=620px"},
2000,
'easeInOutExpo');
$('.click').off('click');
})
}
if ($('.close').one('click')){
$('.close').click(function(){
$('.content, .sec').fadeOut(250);
$('.eneButton').animate(
{"left":"+=310px"},
1500,
'easeInOutExpo')
$('.eneButton').animate(
{ "top":"-=310px"},
1500,
'easeInOutExpo');
$('.giardButton').animate(
{"left":"+=620px"},
2000,
'easeInOutExpo');
$('.giardButton').animate(
{"top":"-=620px"},
2000,
'easeInOutExpo');
$('.mainContent').animate(
{"height":"-=620px"},
3500,
'easeInBack');
$('.click').on('click');
})
}
動畫在兩種方式下都能正常工作,但我需要用戶可以在其關閉時再次重新啓動動畫。從代碼中你可以看到一個點擊並開始動畫,然後你選擇一個類別列表,你可以在窗口中點擊一個「X」來關閉類別列表,當你這樣做時,動畫再次開始直到所有看起來像是開始。現在,如果再次點擊它,動畫不會再啓動。修復按鈕
任何線索?
你能鏈接一個例子嗎?很難明白。 – tobspr
satidrotermica.com –
對不起,正確的鏈接是http://satidrotermica.com/index2.html –