Skip to main content
1-Visitor
August 21, 2020
Solved

Click on image to unvisible

  • August 21, 2020
  • 1 reply
  • 1326 views

Hello everyone,

 

I have a few images.

I want to put alle the images on the same place and that only one of the image is on same time visible.

 

For example:

The first image is visible. I click on the image, then the second image is visible and the first one unvisible. The i click on the second image, the third image is visible and the second image unvisible.

 

Is that possible?

Is there any code to do that so ?

Best answer by sarora

You can apply a javascript function on click of each image...something like the below code:-

 

$scope.clickImage1 = function(){
$scope.view.wdg['image-1']['visible'] = false;
$scope.view.wdg['image-2']['visible'] = true;
$scope.view.wdg['image-3']['visible'] = false;
}


$scope.clickImage2 = function(){
$scope.view.wdg['image-1']['visible'] = false;
$scope.view.wdg['image-2']['visible'] = false;
$scope.view.wdg['image-3']['visible'] = true;
}

 

and so on...

 

Hope this helps !!

1 reply

sarora5-Regular MemberAnswer
5-Regular Member
August 21, 2020

You can apply a javascript function on click of each image...something like the below code:-

 

$scope.clickImage1 = function(){
$scope.view.wdg['image-1']['visible'] = false;
$scope.view.wdg['image-2']['visible'] = true;
$scope.view.wdg['image-3']['visible'] = false;
}


$scope.clickImage2 = function(){
$scope.view.wdg['image-1']['visible'] = false;
$scope.view.wdg['image-2']['visible'] = false;
$scope.view.wdg['image-3']['visible'] = true;
}

 

and so on...

 

Hope this helps !!