JQuery Isotope ordering not ordering divs accurately

微笑、不失礼 提交于 2019-12-12 03:28:55

问题


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();
});

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.

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?


回答1:


for an similar kind of problem, this worked for me

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

docs are here http://isotope.metafizzy.co/v1/demos/layout-modes.html



来源:https://stackoverflow.com/questions/15137293/jquery-isotope-ordering-not-ordering-divs-accurately

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!