Reputation: 243
I have an Image gallery that has three images, I created a thumbnail for the three images and if ever I click on a thumbnail i want it to show on my main image tag.
This is my main image tag:
<img style="width: 100%;" ng-model="" id="viewpic" name="viewpic" src="something.jpg" >
This is my thumbnails:
<img style="width: 28%;" src="images/terminus_63_img3.jpg" onClick="functionshow();">
<img style="width: 28%;" src="images/terminus_63_img3.jpg" onClick="functionshow();">
<img style="width: 28%;" src="images/terminus_63_img3.jpg" onClick="functionshow();">
Upvotes: 0
Views: 923
Reputation: 4713
<img style="width: 100%;" id="viewpic" name="viewpic" ng-src="viewpic" >
<img style="width: 28%;" src="images/terminus_63_img3.jpg" ng-click="functionshow('images/terminus_63_img3.jpg');">
<img style="width: 28%;" src="images/terminus_63_img3.jpg" ng-click="functionshow('images/terminus_63_img3.jpg');">
<img style="width: 28%;" src="images/terminus_63_img3.jpg" ng-click="functionshow('images/terminus_63_img3.jpg');">
in your controller
$scope.functionshow = function (src) {
$scope.viewpic = src;
};
Upvotes: 2