私は巨大なスクロール可能な領域を持っています。1つのセクションに、サムネイルのグリッドがあります。クリックすると、サムが複製され、画面の中央に向かってアニメーション化されます。次に、複製された画像がフェードアウトし、ボックスが大きくなり、(eq)indexを使用してクリックされたサムに関連する記事が読み込まれます。
記事は正常に読み込まれるので、正しくターゲットに設定していることはわかりますが、各記事の高さはコンテンツによって異なるため、表示する前に対応する記事の高さのサイズを変更するボックスが必要です。これを機能させることができないようです。高さを変数に渡して高さをこの値にアニメーション化しようとしましたが、ボックスが高さを0にアニメーション化するため、0が返されるようです。ピクセル値を設定すると問題ありませんが、白がたくさん残ります。下部のスペース。\私が使用しているコードは次のとおりです。
var index = newsover.index($(this)); //cycle through read more links
var offset = $(this).offset(); //Get the thumb position to animate from
var animFinished = false; //Create boolean to check when ani finishes
$('#news-articles .news-article').hide().eq(index).show(); // show the article for the corresponding link and hide the others
var article = $('#news-articles .news-article').eq(index);
var articleClone = article.clone(true); // clone the article for the corresponding link
var articleHeight = article.height();
次に、中央にアニメーション化するようにコード化され、親指の画像がフェードアウトします。これはすべて正常に機能します。それで:
//expand the box further from the center
expandFurther = function() {
expandedItem.animate({
width: 875,
height: articleHeight,
marginTop: -articleHeight/2,
marginLeft: -875/2,
}, {
duration: DDBR.constant.ITEM_ANIMATION_SPEED,
easing: DDBR.constant.ITEM_ANIMATION_EASING,
queue: false,
complete: function() {
animFinished = true;
if (animFinished) {
loadContent();
}
}
})
}; //END expandFurther function
どんな助けでも大歓迎です。よろしくお願いします。