HTML
<ion-slide-box class="pager-pull-right" delegate-handle="sliderBoxTwo" show-pager="true" auto-play="autoPlay" does-continue="false" on-slide-changed="qrcodeChanged($index)" slide-interval="5000" style="width: 220px;margin: 50px auto;visibility: visible;">
<ion-slide class="slider-item" ng-repeat="(key,item) in org.noticeList" repeat-done="repeatDone">
<div class="banner-box" style="width: 100%;margin:0 auto;">
<img ng-src="{{item.userQrCode?item.userQrCode:'http://static.kuaijisishu.com/wx_live/img/no-img.png'}}"
style="width:100%;height: 80%;padding: 5px">
</div>
</ion-slide>
</ion-slide-box>
js
$scope.qrcodeChanged = function (index) {
$scope.qIndex = index;
console.log($ionicSlideBoxDelegate, $ionicSlideBoxDelegate.$getByHandle("sliderBoxTwo").count())
if (($ionicSlideBoxDelegate.$getByHandle("sliderBoxTwo").count() - 1) == index) {
$timeout(function () {
$ionicSlideBoxDelegate.$getByHandle("sliderBoxTwo").slide(0);
}, 5000);
}
};
$scope.repeatDone = function () {
$ionicSlideBoxDelegate.update();
//$ionicSlideBoxDelegate.slide($scope.week.length - 1, 1);
};
当只有两条数据时,html中的does-continue设置为false取消循环播放。
网友评论