2

1 つの jquery アニメーションを使用して要素の高さを 2 回変更したいのですが、できません。どうやってするの?

私はコードを使用しています:

$("#animate").click(function() {
$("#content")
    .animate({"height": "200px"},{"queue": true, "duration": 500})
    .animate({"width": "250px"}, {"queue": true, "duration": 500});
    .animate({"height": "100px"},{"queue": true, "duration": 500})
});

そして、何も起こっていません..しかし、高さのアニメーションのいずれかを削除すると、正常に機能します。前もって感謝します..

4

3 に答える 3

1

チェーンにする:

$("#content").animate({"height": 200}, 500, function(){
   $(this).animate({"width" : 250}, 500, function(){
      $(this).animate({"height" : 100}, 500)
   })
});
于 2013-04-10T06:35:38.163 に答える