admin管理员组文章数量:1356595
I have a masonry container inside of a div that has display:none
in inline style. Because I have a few divs, when the page loads it switches like a slideshow when their button is clicked. This interferes with masonry's ability to gauge the height on load so consequently the bricks spill out of the container.
I have a masonry container inside of a div that has display:none
in inline style. Because I have a few divs, when the page loads it switches like a slideshow when their button is clicked. This interferes with masonry's ability to gauge the height on load so consequently the bricks spill out of the container.
1 Answer
Reset to default 6Update: the .load()
part of my answer is not how this should be done.
See: http://masonry.desandro./layout.html#imagesloaded
You can fix it by:
- Adding
overflow: hidden
to.panel
to clear the floated elements inside. Running Masonry on.load()
instead of.ready()
:<script type="text/javascript"> $(document).load(function (){ $('#contain').masonry({ itemSelector: '.item', columnWidth: 100 }); }); </script>
Version with those fixes: http://jsbin./oyido4/4
本文标签: javascriptjQuery masonry issue with display and height on loadStack Overflow
版权声明:本文标题:javascript - jQuery masonry issue with display and height on load - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744002503a2574115.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论