偶尔会出现一个p重叠在另一个p上的情况,有时不会。
然后改变屏幕宽度时,他会重新排版,就没问题了。这要怎么解决?延时?延迟什么?
注:这是代码一部分
$(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');
});
});
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
setTimeout(function(){
},150);试一下,我最近几天也在用这个插件写动态加载出来的瀑布流效果