1

我一直在尝试让 Isotope 正确渲染时遇到问题。

我尝试了几种不同的方法来让它工作,包括使用 imagesLoad 函数,但无济于事。

您可以在此处查看该页面:http ://wpsanjose.com/#latest-posts

如果您选择“全部”,您将看到正确的边距出现,这是我第一次弹出时所追求的。

这是我正在使用的代码:

(function($) {

$(window).load(function() {

    //Set the isotope area
    var $container = $('#isotope-wrap');

    //Set our items to be filtered and how to display
    $container.isotope({
        itemSelector: 'article',
        masonry: {
            columnWidth: 1
        }

    });

    var $filterSets = $('.options'),
            $filterLinks = $filterSets.find( 'a' );

    $filterLinks.click(function() {
        var $this = $(this);
        // don't do anything if already selected
        if ( $this.hasClass('selected') ) {
            return false;
        }

        var $filterSet = $this.parents('.options');
        $filterSet.find('.selected' ).removeClass('selected');
        $this.toggleClass('selected');

    })

    // filter items when filter link is clicked
    jQuery('#filters a').click(function(){
        var selector = $(this).attr('data-filter');
            $container.isotope({
                filter: selector
        });

        return false;
    })

});


$(".entry").hover(
    function() {
        $(".article-outer", this).stop().animate({top: '-1000px'},{queue: false, duration: 700});
    },

    function() {
        $(".article-outer", this).stop().animate({top: '0px'},{queue: false, duration: 700});
    });

})(jQuery);

任何帮助将不胜感激!

4

0 回答 0