试图在调整大小时显示隐藏的内容

时间:2012-12-19 19:40:22

标签: jquery-isotope

我目前正在使用同位素来帮助我调整大小并重新布置一组盒子。当它调整其中一个div时,我想用隐藏的div替换内容。

以下是一些提出想法的代码:

$('#container-2').isotope({
    childSelector: '.child-big',
    masonry: {
        columnWidth: 468
    };
});


$('.child-big').click(function() {
    var $this = $(this);
    if ($this.hasClass('tall')) {
        tileStyle = {
            width: 468,
            height: 150
        };
    }
    else {
        tileStyle = {
            width: 468,
            height: 190
        };
    }

    $this.toggleClass('tall');

    $this.find('.child-content').stop().animate(tileStyle);

    $('#container-2').isotope('reLayout')

});​

还有更多代码,如果有帮助:http://jsfiddle.net/Mx6KH/4/

我不知道如何让它切换。在这个项目的早期版本中,我一直在使用jQueryUI的addClass和removeClass函数,但我不确定这个设置是否仍然合适,或者是否有更简单的方法来实现它;这有点笨拙。

0 个答案:

没有答案