$('.switchpic1').animate({
opacity:?'1',
left:?'4%'},
'slow',?function()?{
$('.picSwitchPage>span[data-num*="0"]').toggleClass('cur');
$('.switchpic1').stop().animate({opacity:?'0'},1000);
/*?stuff?to?do?after?animation?is?complete?*/
});
$('.switchtxt1').animate({
opacity:?'1',
right:?'8%'},
'slow',?function()?{
$('.switchtxt1').stop().animate({opacity:?'0'},1000);
/*?stuff?to?do?after?animation?is?complete?*/
});
$('.switchpic2').animate({
opacity:?'1',
left:?'-28%'},
'slow',?function()?{
$('.picSwitchPage>span[data-num*="1"]').toggleClass('cur');
$('.switchpic2').stop().animate({opacity:?'0'},1000);
/*?stuff?to?do?after?animation?is?complete?*/
});
$('.switchtxt2').animate({
opacity:?'1',
right:?'5%'},
'slow',?function()?{
$('.switchtxt2').stop().animate({opacity:?'0'},1000);
/*?stuff?to?do?after?animation?is?complete?*/
});
1 回答

stone310
TA貢獻(xiàn)361條經(jīng)驗(yàn) 獲得超191個(gè)贊
創(chuàng)建個(gè)變量 var flag=0(放在事件調(diào)用函數(shù)內(nèi));然后分別在2個(gè)1動(dòng)畫(huà)的最終完成狀態(tài)內(nèi)放上flag++;
在2動(dòng)畫(huà)前加上判斷if(flag==2){執(zhí)行2個(gè)2動(dòng)畫(huà)};
具體情況要看怎么調(diào)用這個(gè)動(dòng)畫(huà),要避免因多次調(diào)用1動(dòng)畫(huà)而導(dǎo)致flag無(wú)限上漲的問(wèn)題
- 1 回答
- 0 關(guān)注
- 2180 瀏覽
添加回答
舉報(bào)
0/150
提交
取消