Javascript 像密集的街区?
请帮忙解决这个问题。对于密集的填充块,我使用了一种流行的插件砌体 我的结果不起作用。但是我使用了 css:Javascript 像密集的街区?,javascript,jquery,jquery-masonry,Javascript,Jquery,Jquery Masonry,请帮忙解决这个问题。对于密集的填充块,我使用了一种流行的插件砌体 我的结果不起作用。但是我使用了 css: 你的小提琴参考了图书馆 对于此语法(): 使用链接到的文档中的as $('#container').masonry({ itemSelector: '.box', // set columnWidth a fraction of the container width columnWidth: function( containerWidth ) { return co
你的小提琴参考了图书馆 对于此语法(): 使用链接到的文档中的as
$('#container').masonry({
itemSelector: '.box',
// set columnWidth a fraction of the container width
columnWidth: function( containerWidth ) {
return containerWidth / 5;
}
});
#container{
max-width: 1000px;
margin: 0 auto;
overflow: hidden;
}
#container .item{
width: 33.3%;
background: red;
float: left;
}
$('#container').masonry({
itemSelector: '.box',
// set columnWidth a fraction of the container width
columnWidth: function( containerWidth ) {
return containerWidth / 5;
}
});