Hello,
I try to make a carousel of images using ion-slide-box. Here is my code:
<ion-slide-box delegate-handle="img-viewer" auto-play="false" does-continue="true" ng-if="zaved_img.length > 0">
<ion-slide ng-repeat="img1 in zaved_img">
<div class="item item-image">
<img ng-src="http://site.ru/admin/files/{{img1.img}}">
</div>
</ion-slide>
</ion-slide-box>
How to open image on click and view by scrolling left/right swipe?
Sorry, my english is bad.
Create a method for click on image and use ng-click in in your slide box…it is simple
Please help for example method
app.js
$scope.clickOnImg=function(img){
alert("img " +img);
}
img.html
<ion-slide-box delegate-handle="img-viewer" auto-play="false" does-continue="true" ng-if="zaved_img.length > 0">
<ion-slide ng-repeat="img1 in zaved_img">
<div class="item item-image">
<img ng-src="http://site.ru/admin/files/{{img1.img}}" ng-click="clickOnImg({{img1.img}})">
</div>
</ion-slide>
</ion-slide-box>
Dont work this code. Why you use “Alert” ???
alert is just for testing…for check method is working or not… it can be replace with your code…don’t think about it