我得到了错误:
cannot call methods on masonry prior to initialization; attempted to call 'appended'我查看了关于这个问题的各种questions和masonry自己的FAQ。
我实现了建议的修复,但没有运气,我得到了相同的错误,我甚至回到了基础并执行了以下操作:
imagesLoaded(this.galleryGrid, function(instance) {
var msnry = new Masonry('.grid', {
itemSelector: '.item',
columnWidth: '.item'
});
var $newElems = $('.test').clone();
$('.grid').masonry('appended', $newElems );
});我仍然得到相同的错误。有什么解决方案吗?
发布于 2015-05-02 22:35:47
你有没有试过这个:
imagesLoaded(this.galleryGrid, function(instance) {
var msnry = new Masonry('.grid', {
itemSelector: '.item',
columnWidth: '.item'
});
var $newElems = $('.test').clone();
$('.grid').append( $newElems ).masonry('appended', $newElems );
});https://stackoverflow.com/questions/29971562
复制相似问题