2014-10-27 96 views
2

我有以下的模板(請注意我用的angular-masonry-directive):角砌體多列

<div masonry='{ "transitionDuration" : "0.4s" , "itemSelector" : ".tile", "columnWidth":1}'> 
    <div masonry-tile ng-repeat="item in queryset" class="tile"> 
     <item ng-class-odd="'odd'" ng-class-even="'even'"></item> 
    </div> 
</div> 

當我指定.odd的寬度,以像素爲單位。即使,例如它的偉大工程600px和300px,但當我使用百分比時不會60%和30%。砌體還有可能嗎?如果不是,你會建議什麼?謝謝!

回答

0

percentPosition: true添加到砌體設置。這告訴砌體根據百分比計算寬度。

<div masonry='{ "transitionDuration" : "0.4s" , "itemSelector" : ".tile", 
"columnWidth":1, percentPosition: true}'> 
    <div masonry-tile ng-repeat="item in queryset" class="tile"> 
     <item ng-class-odd="'odd'" ng-class-even="'even'"></item> 
    </div> 
</div> 

查看更多選擇這裏:masonry.desandro.com/options.html