You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$(document).ready(function() {
$('#masonry-container').masonry({
itemSelector: '.box',
// set columnWidth a fraction of the container width
columnWidth: function( containerWidth ) {
return containerWidth / 3;
}
});
});
But the images (usually much larger than containerWidth / 3) take up more space and the entire layout is messed up. Passing width: 300 in the image_tag prevents this, but defeats the purpose of a fluid width.
How can I get this to work?
The text was updated successfully, but these errors were encountered:
Sounds like something specific to Masonry configuration, maybe an addon/plugin for masonry? See if you can find Masonry solutions/examples that function the way you desire with respect to automatic image resize.
Some more information about how the layout is incorrect would be useful. If you have a fixed containerWidth and images larger than the desired columnWidth, than you'll at least need a max-width percent constraint in order to eliminate overflow effects.
I have the following code:
In application.js:
application.scss:
_model.html.erb:
js.erb:
But the images (usually much larger than
containerWidth / 3
) take up more space and the entire layout is messed up. Passingwidth: 300
in theimage_tag
prevents this, but defeats the purpose of a fluid width.How can I get this to work?
The text was updated successfully, but these errors were encountered: