For your example, I believe you want to set columnWidth: 330 This because col4 have 300px width + 10px left padding + 10px right padding + 5px left margin + 5px right margin.
Then set .col5 { width: 630px } so .col5 brick fits right in.
I strongly recommend against using columnWidth: 1 as a solution. When you set the columnWidth to 100, that means, for every 100 pixels, the script tries to find the best position for the 'brick.' If the brick is 100px wide, and the container is 800px wide, that loop will be 8 iterations. If the columnWidth is 1, the loop is 800. You are incurring way too many iterations within the loop.
from masonry.
Comments (4)
Do you have a live link I could take a look at? You could try to reproduce it in http://jsfiddle.net
from masonry.
Thanks for response,
here jsfiddle link : http://jsfiddle.net/ANx8C/
from masonry.
I find an solution working in Firefox.
Put
masonryOptions={
columnWidth: 1, }
look the jsfiddle link
Thank a lot
from masonry.
For your example, I believe you want to set
columnWidth: 330
This because col4 have 300px width + 10px left padding + 10px right padding + 5px left margin + 5px right margin.Then set
.col5 { width: 630px }
so.col5
brick fits right in.see http://jsfiddle.net/ANx8C/5/embedded/result/ --- code: http://jsfiddle.net/ANx8C/5/
I strongly recommend against using
columnWidth: 1
as a solution. When you set the columnWidth to 100, that means, for every 100 pixels, the script tries to find the best position for the 'brick.' If the brick is 100px wide, and the container is 800px wide, that loop will be 8 iterations. If the columnWidth is 1, the loop is 800. You are incurring way too many iterations within the loop.from masonry.
Related Issues (20)
Recommend Projects
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
web
Some thing interesting about web. New door for the world.
server
A server is a program made to process requests and deliver data to clients.
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Visualization
Some thing interesting about visualization, use data art
Game
Some thing interesting about game, make everyone happy.
Recommend Org
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.