我使用angularJS和bootstrap来显示轮播。我使用角度获取图像,现在使用ng-repeat我想在旋转木马中显示它们。但我面临一个问题,所有的图像都排在另一个下面。我该如何解决这个问题?
我的代码显示轮播:
<div id="carousel-example-generic" class="carousel slide"
data-ride="carousel" align="center">
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
</ol>
<div class="carousel-inner" role="listbox" ng-controller="bannerCtrl">
<div>
<div class="item" data-ng-repeat="banner in banners">
<img src="{{banner.bannerUrl}}" alt="{{banner.bannerAltText}}">
<div class="carousel-caption">{{banner.bannerAltText}}</div>
</div>
</div>
</div>
<a class="left carousel-control" href="#carousel-example-generic"
role="button" data-slide="prev"> <span
class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a> <a class="right carousel-control" href="#carousel-example-generic"
role="button" data-slide="next"> <span
class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
答案 0 :(得分:1)
您可以使用偏移x来进行轮播图像定位。 或者你可以简单地使用angular-carousel https://github.com/revolunet/angular-carousel