angular-swiper
angular-swiper copied to clipboard
Cannot seem to get auto play to work in ionic
I have a slider on my page and cannot get autoplay to work even though I have added it to my slider. Is there anything more required to get it working?
<ks-swiper-container speed="2000" autoplay="1000" initial-slide="0" style="border-bottom: 1px solid #ccc!important;" loop="true" show-nav-buttons="true" class="swiper-button-white" slides-per-view="1" space-between="1" pagination-clickable="true" on-ready="onReadySwiper(swiper)">
<ks-swiper-slide class="swiper-slide" ng-repeat="topstory in topstories">
<a ng-href="#/app/topstories/{{topstory.id}}">
<img ng-src="{{topstory.thumbnail_images.td_533x261.url}}" width="100%">
<img src="img/notFound.jpg" ng-if="!topstory.thumbnail">
<h6 style="font-weight: 300;font-size: 18px;letter-spacing: 1pt;top: 139px;text-align: left;position: absolute;display: block;width: 100%;color: #fff;background: #222;padding: 9px 8px 28px 8px;" ng-bind-html="topstory.title"></h6>
</a>
</ks-swiper-slide>
</ks-swiper-container>
I have the same problem, it works only for one slider , on the other hand for second and third it doesn't works.
check at this.. http://idangero.us/swiper/api/#.V3BgI5N96YV
do your own search first then ask. this guy already put some effort to provide the code for us. At least what we can do is do some search before asking
add ng-if, My code follow:
<ks-swiper-container ng-if="home.bannerContent[0] && home.bannerContent[0].content.length>0" autoplay="3000" loop="true" on-ready="onReadySwiper(swiper)" pagination-is-active="true" > <ks-swiper-slide class="swiper-slide" ng-repeat="item in home.bannerContent[0].content"> <a ng-href="{{item.linkUrl}}"> <img ng-src="{{item.imgUrl}}" alt="" /> </a> </ks-swiper-slide> </ks-swiper-container>