0

上記のdivの高さを同時にアニメーション化しながら、divへのスクロールをアニメーション化しようとしています。スクロールとアニメーションはどちらも独立して機能しますが、同時には機能しません。私は彼らが何らかの形で矛盾していると思います。何か案は?

setTimeout(function() {
  $("html,body").animate({scrollTop: $(".hublot").offset().top}, 500);
  $(".hublot").animate({height:$(window).height()}, 500, 'easeInOutQuart');
}, 500);
4

2 に答える 2

0

キューの使用を修正しました。ただし、イージングとキューの両方を省略形で記述する方法がわかりませんでした。

    $("html,body").animate({scrollTop: $(".hublot").offset().top}, 500, false);
    $(".hublot").animate({height:$(window).height()}, {duration: 500, easing:"easeInOutQuart", queue: false});
于 2013-10-20T04:38:11.743 に答える
0

次のように、個別にではなく、一度にすべてアニメーション化する必要があります。

setTimeout(function() {
   $("html,body").animate({
       scrollTop: $(".hublot").offset().top, 
       height: $(window).height()
    }, duration: 500,
    specialEasing: {
       height: "easeInOutQuart"
    });
}, 500);
于 2013-10-20T03:40:33.893 に答える