本文介绍了jQuery同位素排序不正确地排序div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网址是leftsideart(点)co(点)nz

My url is leftsideart (dot) co (dot) nz

我正在使用以下同位素设置:

I am using the following isotope setup:

jQuery('#post-area').isotope({
    animationOptions: {
        duration: 750,
        easing: 'linear',
        queue: false
    },
    getSortData : {
        number : function( $elem ) {
        return parseInt( $elem.find('.order').text(), 10 );
        }
    },
    sortBy : 'number',
    sortAscending : true,
    animationEngine : 'jquery'
});

var jQuerycontainer = jQuery('#post-area');
jQuerycontainer.imagesLoaded( function() {
    jQuerycontainer.isotope();
});

但是我的div排序不正确.同位素肯定会影响顺序,因为我尝试在wordpress循环中回显随机数,而不是递增数字,因此divs会随机播放.

but my divs are not ordering correctly. Isotope is definitely affecting the order as I have tried echoing random numbers in my wordpress loop as opposed to incrementing numbers and the divs shuffle accordingly.

此外,可以肯定的是,当我将"sortAscending"更改更改为false时,div的一般顺序将颠倒.

Also, just to be sure, when I change the change 'sortAscending' to false then the general order of the divs is reversed.

同位素是否仅提供常规订购而不是精确订购?

Does Isotope offer only a general ordering as opposed to an exact ordering?

推荐答案

对于类似的问题,这对我有用

for an similar kind of problem, this worked for me

layoutMode: 'cellsByColumn',
cellsByColumn: {
  columnWidth: 240,
  rowHeight: 360
}

docs在这里 http://isotope.metafizzy.co/v1/demos /layout-modes.html

这篇关于jQuery同位素排序不正确地排序div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 01:40