标签:
(1)service.js中增加
.factory(‘Banners‘, function() {
var banners = [{
id: 0,
src:‘img/banner1.png‘,
}, {
id: 1,
src:‘img/banner2.png‘,
}, {
id: 2,
src:‘img/banner3.png‘,
}, {
id: 3,
src:‘img/banner4.png‘,
}];
return {
all: function() {
return banners;
}
};
})
(2)在页面中增加
<ion-slide-box show-pager="true" class="slidebox" auto-play="true" slide-interval="4000" delegate-handle="slideimgs" does-continue="true">
<ion-slide ng-repeat="banner in banners">
<img ng-src="{{banner.src}}"class="a-img-100">
</ion-slide>
</ion-slide-box>
(3)在controller中增加
//滚动图
$scope.banners = Banners.all();
$ionicSlideBoxDelegate.update();
$ionicSlideBoxDelegate.$getByHandle(‘slideimgs‘).loop(true);
便可完成轮番滚动的图片
so easy ,,,麻麻在也不用担心我的学习了...
标签:
原文地址:http://www.cnblogs.com/he0xff/p/5725885.html