javascript - How Do I pass an image source to a variable in a function to be then shown to a image tag -


i have image gallery has 3 images, created thumbnail 3 images , if ever click on thumbnail want show on main image tag.

this main image tag:

<img style="width: 100%;" ng-model="" id="viewpic" name="viewpic" src="something.jpg" > 

this 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();"> 

<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 controller

$scope.functionshow = function (src) { $scope.viewpic = src; }; 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -