0

幻灯片动画不流畅,我用谷歌搜索了一下,发现我需要为我的容器设置一个固定的宽度,但容器的宽度设置为在其他 2 个 div 之间填充。

$('.content_block .content_block_title').on("click", function(event) {
    var target = event.target || event.srcElement;
    var child = $(target).next();

    child.css('width', child.width()); //tried with this but it didnt make the anim smoother.
    if (!child.is(':hidden'))
        child.slideUp(350);
    else
        child.slideDown(150);
});
4

1 回答 1

0
if (!child.is(':hidden'))
        child.animate({    
           height: "350px"
        }, 5000, function() {
           // Animation complete.
        });
    else
        child.animate({    
           height: "150px"
        }, 5000, function() {
          // Animation complete.
        });
于 2013-10-09T12:37:25.990 回答