下拉刷新ion-refresher和轮播ion-slide-box混合,刷新后图片错位
不多说。直接上代码这是html部分<ion-refresher pulling-text="正在刷新" on-refresh="doRefresh()"></ion-refresher><div class="home-slide"> <ion-slide-box does-continue="true" auto-play="true" slide-interval="2000"> <ion-slide ng-repeat="bannerSrc in bannerSrcList" does-continue="true" slide-interval="true"> <a ng-href="{{bannerSrc.url}}"> <img ng-src="{{bannerSrc.imgSrc}}" alt="{{bannerSrc.name}}"> </a> </ion-slide> </ion-slide-box></div>这是controller.controller("homeCtrl", function ($scope, $http, $timeout, $ionicSlideBoxDelegate, handleArray, randomNumber) { var tabHomeUrl = define.mainUrl + "/tab/tab-home.json";
$http.get(tabHomeUrl,{type:0}) .success(function (data) { //console.log(angular.toJson(data, true)); //轮播数据 $scope.bannerSrcList = data.bannerSrcList; }); $timeout(function () { $ionicSlideBoxDelegate.$getByHandle('slideimgs').update(); $ionicSlideBoxDelegate.$getByHandle('slideimgs').loop(true); }, 100); //刷新处理 $scope.doRefresh = function () { $http.get(tabHomeUrl,{type:1}) .success(function (newData) { /* * 此处有问题 */ $scope.bannerSrcList = newData.bannerSrcList; console.log("刷新数据成功") }).finally(function () { $scope.$broadcast('scroll.refreshComplete'); }); };
})webkit-fake-url://ca57ba1e-1fb5-4d71-b05a-324505b4e00a/image.tiff
http://bbs.phonegap100.com/thread-3726-1-1.html 这个看看 http://www.phonegap100.com/thread-3729-1-1.html
页:
[1]