1

height()それぞれに異なる変数を持つ複数のロードされた要素の変数を宣言した後、animate()関数は variable をロードしていないようですexcHeight

excHeight以下のように の値を使用する最良の方法は何animate()ですか?

$(".exPand a").click(function (event) {
    event.preventDefault();

    var post_id = $(this).attr("rel");

    var postHeight = $(this).closest('.boxy')
                            .find('.articleImageThumb')
                            .height();

    var excHeight = $(this).closest('boxy')
                           .find('.articleImageThumb')
                           .find('.initialPostLoad')
                           .height();

    $.ajaxSetup({cache:false});

    $(this).closest('.boxy')
           .animate({height: postHeight+excHeight}, 1000);

    $(this).closest('.boxy')
           .find('.articleImageThumb')
       .animate({top: 0}, 1000);

    $(this).closest('.boxy').find('.articleTitle')
    .animate({bottom: excHeight}, 1000);

    $(this).closest('.boxy').find('.postmetadata')
    .animate({bottom: excHeight}, 1000);
});
4

1 に答える 1

4

boxyクラス名の「ドット」を忘れたため、機能していないようです: var excHeight = $(this).closest('boxy')、次のようにする必要があります:var excHeight = $(this).closest('.boxy')

于 2013-06-27T17:41:47.390 に答える