- JScript code
$('div').animate(width:'300px',300,function(){ alert('ok'); });
这样是能正常回调的,但是我想要多个动画无队列执行完后回调就不行了,如:
- JScript code
$('div').animate(width:'300px',{ duration: 300, queue: false }); $('span').animate(width:'300px',{ duration: 300, queue: false }); $('p').animate(width:'300px',{ duration: 300, queue: false },function(){ alert('ok'); });
------解决方案--------------------
- JScript code
$('div').animate({ width: '300px', duration: 300, queue: false }); $('span').animate({ width: '300px', duration: 300, queue: false }); $('p').animate({ width: '300px', duration: 300, queue: false }, function() { alert('ok'); });
------解决方案--------------------
- JScript code
//更加规范点的写法 $("div").animate({ width: '300px' }, { duration: 300, queue: false }); $("span").animate({ width: '300px' }, { duration: 300, quequ: false }); $("p").animate({ width: '300px' }, { duration: 300, queue: false, complete: function() { alert('OK'); } });