猿问

关于jquery瀑布流插件masonry的问题。

偶尔会出现一个div重叠在另一个div上的情况,有时不会。

然后改变屏幕宽度时,他会重新排版,就没问题了。这要怎么解决?延时?延迟什么?
注:这是代码一部分

$(function() {    var $container = $('#masonry');
    $container.imagesLoaded(function() {
        note.grid = $container.masonry({            itemSelector: '.box',            gutterWidth: 10,            isAnimated: true,            isFitWidth: true,            isResizableL: true
        });
        note.items = $(html);
        note.grid.append(note.items).masonry('appended', note.items).masonry('reloadItems').masonry('layout');
    });
});


吃鸡游戏
浏览 918回答 1
1回答

慕尼黑的夜晚无繁华

setTimeout(function(){                          $container.append($div).fadeIn("4000").masonry("appended" , $div);},150);试一下,我最近几天也在用这个插件写动态加载出来的瀑布流效果
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答