嘗試在AngularJS中獲得重複的兩列布局時出現問題。我的數據集是圖像信息的JSON對象。我想顯示圖像的兩列布局。無論我調整什麼,奇偶邏輯都有問題,但我似乎無法弄清楚。我究竟做錯了什麼?AngularJS:雙列奇/偶佈局
.left {
float: left !important;
width: 50% !important;
}
.right {
float: right !important;
width: 50% !important;
}
.group:after {
content:"";
display: table;
clear: both;
}
img {
max-width: 100%;
height: auto;
}
@media screen and (max-width: 480px) {
.left,
.right {
float: none;
width: auto;
}
}
<div ng-repeat="issue in issues">
<div ng-if="$even" class="group">
<div class="left" ng-if="$even">
<img src="{{ issue.image }}" ng-src="{{ issue.image }}">
</div>
<div class="right" ng-if="$odd">
<img src="{{ issue.image }}" ng-src="{{ issue.image }}">
</div>
</div>
</div>
太棒了,Pankaj。我不知道這些指令.. – developer033
感謝隊友的讚賞!乾杯;) –
我不敢相信我錯過了...驚人的,謝謝潘卡! –