update()
更新滑动框(例如,用带有ng-repeat的Angular,调整它里面的元素)。
slide(to, [speed])
是否启动滑动框功能
previous()
跳转到上一个滑块。如果在开始滑块,就循环。
next()
跳转到下一个滑块。如果在结尾就循环。
stop()
停止滑动。滑动框将不会再被滑动,直到再次启用。
currentIndex()
返回: 当前滑块的索引数值。
slidesCount()
返回: 当前滑块的数目。
$getByHandle(handle)
返回: delegateInstance一个只控制带有delegate-handle的ionSlideBox指令的授权实例来匹配给定句柄。
例如: $ionicSlideBoxDelegate.$getByHandle('my-handle').stop();
ps:
<ion-content class="bgcolor-eee" has-bouncing="false"> <ion-scroll direction="xy" scrollbar-x="false" scrollbar-y="false" has-bouncing="false"> <ion-slide-box ng-if="restaurantList" on-slide-changed="slideHasChanged($index)" show-pager="true" does-continue="true" auto-play="true" slide-interval="4000"> <ion-slide ng-repeat="restaurant in restaurantList"> <div class="mainSlide"> <div class="ui-square2 margin-left-5" ng-click="(restaurant[0].id == 0)?restaurantLists():restaurantDetail(restaurant[0].id)"> <img ng-show="restaurant[0].state == 1" ng-src="{ {restaurant[0].file_path}}"> <img ng-show="restaurant[0].state == 0" class="grayPic" ng-src="{ {restaurant[0].file_path}}"> <div class="title text-center"> <span class="titleName">{ {restaurant[0].name}}</span> </div> </div> <div ng-if="restaurant[1]" class="ui-square2" ng-click="(restaurant[1].id == 0)?restaurantLists():restaurantDetail(restaurant[1].id)"> <img ng-show="restaurant[1].state == 1" ng-src="{ {restaurant[1].file_path}}"> <img ng-show="restaurant[1].state == 0" class="grayPic" ng-src="{ {restaurant[1].file_path}}"> <div class="title text-center"> <span class="titleName">{ {restaurant[1].name}}</span> </div> </div> </div> </ion-slide> </ion-slide-box></ion-scroll>
</ion-content >