我不会建议使用ion-slide-box
,因为它已被弃用并将被删除。
已过时API
将在接下来的离子释放赞成新 离子滑动部件的被移除。不要依赖此 部件的内部行为 - source.
而是使用基于Swiper API新ion-slides
。该API为幻灯片提供了更多灵活性(请参阅链接中的Swiper参数部分)。例如,您可以降低转换的速度,甚至可以降低某些幻灯片的自动播放速度。
自动播放
延迟之间的转换(毫秒)。如果没有指定这个参数,自动播放将被禁用
如果需要指定特定的幻灯片不同的延迟,你可以通过幻灯片使用数据的刷卡自动播放(毫秒)属性做 它:
<div class="swiper-slide" data-swiper-autoplay="2000">
使用基本例如新的幻灯片:
HTML
<ion-content scroll="false">
<ion-slides options="options" slider="data.slider">
<ion-slide-page>
<div class="box blue"><h1>BLUE</h1></div>
</ion-slide-page>
<ion-slide-page>
<div class="box yellow"><h1>YELLOW</h1></div>
</ion-slide-page>
<ion-slide-page>
<div class="box pink"><h1>PINK</h1></div>
</ion-slide-page>
</ion-slides>
</ion-content>
控制器
$scope.options = {
loop: false,
effect: 'fade',
speed: 500,
}
$scope.$on("$ionicSlides.sliderInitialized", function(event, data){
// data.slider is the instance of Swiper
$scope.slider = data.slider;
});
$scope.$on("$ionicSlides.slideChangeStart", function(event, data){
console.log('Slide change is beginning');
});
$scope.$on("$ionicSlides.slideChangeEnd", function(event, data){
// note: the indexes are 0-based
$scope.activeIndex = data.slider.activeIndex;
$scope.previousIndex = data.slider.previousIndex;
});
全Codepen例here.
http://ionicframework.com/docs/api/directive/ionSlideBox/检查文档,并尝试使用slide-interval属性,因为他们提到 –
感谢您的重播@SaEChowdary。这是完美的工作。但我问的问题是如何减少自动播放速度? – Periyasamy
add slide-interval =“10000”并检查一次“ –