2015-02-04 3 views
-2

문제를 해결하는 데 도움을주십시오. 조밀 한 패킹 블록을 위해 나는 대중적인 플러그 접속 식 벽돌을 사용했다.은 고밀도로 포장 된 블록입니까?

내 결과 code은 작동하지 않습니다.

#container{ 
    max-width: 1000px; 
    margin: 0 auto; 
    overflow: hidden; 
} 

    #container .item{ 
     width: 33.3%; 
     background: red; 
     float: left; 
    } 

답변

0

당신의 바이올린은 masonry v3 라이브러리를 참조 :하지만 난 documentation

$('#container').masonry({ 
    itemSelector: '.box', 
    // set columnWidth a fraction of the container width 
    columnWidth: function(containerWidth) { 
    return containerWidth/5; 
    } 
}); 

CSS에 기술 된 방법을 사용했다. 이 구문 (http://jsfiddle.net/6ashzfo6/4/)에 대한

:

$('#container').masonry({ 
    itemSelector: '.box', 
    // set columnWidth a fraction of the container width 
    columnWidth: function(containerWidth) { 
    return containerWidth/5; 
    } 
}); 

당신이에 링크 된 문서에서와 같이 v2.1.08를 사용합니다.