我正在尝试将 swiper.js 集成到显示背景图像的 angularJs 网络应用程序中。该库正在运行,但图像未正确显示。请查看这个与我的应用程序完全一样工作的 plunker。
http://plnkr.co/edit/ISdEZn?p=preview
下面是最相关的部分:
<!-- Slider main container -->
<div class="swiper-container" swiper>
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<!-- Slides -->
<!--<div class="swiper-slide">Slide 1</div>-->
<!--<div class="swiper-slide">Slide 2</div>-->
<!--<div class="swiper-slide">Slide 3</div>-->
<div class="swiper-slide" ng-repeat="boatPhoto in boatPhotos" is-loaded>
<div style="margin:auto; background-image: url('//s3-eu-west-1.amazonaws.com/yanpy.dev/img/boats/13620/l/{{boatPhoto.name}}.{{boatPhoto.mime}}')">
</div>
</div>
</div>
<!-- If we need pagination -->
<div class="swiper-pagination"></div>
<!-- If we need navigation buttons -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<!-- If we need scrollbar -->
<div class="swiper-scrollbar"></div>
</div>