呼び出しでコールバックメソッドを宣言する必要がありanimate
ます!
$('#capePowerpoint').animate({"right": "+=498px"}, {duration:1000,complete:function(){
$('#capePowerPointContainer').html(capTabArray[capTabCounter][capabilitiesCounter]);
$('#capePowerpoint').animate({"right": "-=996px"}, {duration:0,complete:function(){
$('#capePowerpoint').animate({"right": "+=498px"}, 1000);
});
});
詳細:http ://api.jquery.com/animate/
私のようにjQueryメソッドに興味がありすぎる場合はanimate
(嫌いです)、GreenSockのTweenLiteライブラリを参照してください。
http://www.greensock.com/v12/
編集:あちこちでクエリを実行するのではなく、要素を保存する必要があります
var cape = $('#capePowerpoint'), container = $('#capePowerPointContainer');
cape.animate({"right": "+=498px"}, {duration:1000,complete:function(){
container.html(capTabArray[capTabCounter][capabilitiesCounter]);
cape.animate({"right": "-=996px"}, {duration:0,complete:function(){
cape.animate({"right": "+=498px"}, 1000);
});
});