Masonry doesn't work on moblie browser (chrome) and it doesn't work in Chrome on refresh (f5). It does work correctly if I load the page in any other browser or if I fully reload the page without using its cache (ctrl+5). It also doesn't work on jsfiddle.
I know it should work because the Masonry site itself does work on these browsers.
I'm using a grid size container for defining the column width, and have tiles with different dimensions:
.project {
width: $column_width;
}
.grid-sizer {
width: $column_width;
}
.project.oneXtwo {
width: $column_width;
height: (2* $column_width);
}
.project.twoXone {
width: (2* $column_width);
height: $column_width;
}
.project.twoXtwo {
width: (2* $column_width);
height: (2* $column_width);
}
Masonry gets initiated on page load:
columnWidth = $(".project").width();
$(".project").height(columnWidth);
$(".twoXtwo").height(columnWidth * 2);
$(".oneXtwo").height(columnWidth * 2);
container.masonry({
columnWidth: ".grid-sizer",
itemSelector: '.project',
isAnimated:true,
});
Here is the jsfiddle for the code: http://jsfiddle.net/BartBurg/BtKHL/ note: in jsfiddle it doesn't work on any other browser either.
Edit:
Firefox also has this problem if I reload the page by accessing the website for the second time (not on refresh/reload)