Adding Elements #11
Comments
It must be a bug, because |
Hi landman I had the same problem when I initialised the plugin as follows: HTML snippet: <div class="clearfix" id="images">
<div class="single-image" id="dummy-image"></div>
</div> JS snippet: $(document).ready(function() {
var imagesMosaicFlow = $('#images').mosaicflow({
itemSelector: '.single-image',
itemHeightCalculation: 'attribute'
});
// code to create elements with class "single-image"
imagesMosaicFlow.mosaicflow('add', elem);
}); However, if I used an empty HTML div, like so: <div class="clearfix" id="images">
</div> Everything worked fine. Dunno about your use case, but maybe try that? |
@robinchow, in your JS snippet you're using |
I'm having the same issue as landman. I'm using the jQuery Infinite Scroll plugin, and adding the newly loaded photos using a custom callback:
Everything works as expected, except for the fact that items are only added to the left most column. |
I'm having the exact same problem as @david-wilson with Infinite Scroll. Should the new items have the itemSelector class (.photo in david-wilson's example)? If I add it then they all appear in one column, if I don't then they appear in multiple columns but the layout is all off. |
As a temporary fix I am skipping add and manually adding to each column: var i = 0;
$.each(dat.data, function(idx, itm){
//mosaicflow('add', $(itm.item));
$('.mosaicflow__column').eq(i).append(itm.item);
i++;
if(i == $('.mosaicflow__column').length)
i = 0;
}); |
Seems to be fixed |
I was wrong. Currently working on patch |
I found problem. Adding is synchronous and problem is in other place — in calculation height of added element |
The problem was in images which have no height at the adding moment, that's why lowest column haven't been changed and all blocks added to it. I will deliver patch in few hours |
@matmuchrapna Great 👍 |
Hi, if I add an image the mosaicflow doesn't works. Only the first "insertion" works. span "don't works" adds:
span "works" adds:
if i add an image, the script adds the first box in the right place, but after the first, all the boxes are put in the last column. |
Thank you for report, I will take a look at your case today |
Hey (-:
I love Mosaicflow but there is one Problem. When i add (container.mosaicflow('add', elm);) new Items they will be show only in the left column. What can i Do?
The text was updated successfully, but these errors were encountered: