$('.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贡献361条经验 获得超191个赞
创建个变量 var flag=0(放在事件调用函数内);然后分别在2个1动画的最终完成状态内放上flag++;
在2动画前加上判断if(flag==2){执行2个2动画};
具体情况要看怎么调用这个动画,要避免因多次调用1动画而导致flag无限上涨的问题
- 1 回答
- 0 关注
- 2117 浏览
添加回答
举报
0/150
提交
取消