cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Controlling Model Item Opacity Using Toggle Button

abhishekkanoo
6-Contributor

Controlling Model Item Opacity Using Toggle Button

I want to decrease the opacity of a model item by half on clicking a toggle button. I am attching screenshots of my approach to doing it. 

I am unable to do it.

Kindly tell me where I am going wrong. 

1 REPLY 1

You would need to tie the 'pressed' event to the opacity of the model-item. You can use an application parameter and a simple javascript function to achieve this.

 

I ran a small test to confirm this would work. I created an app parameter called 'OpacityMI' and bound it to the model item opacity. in Home.JS I added this function:

 

$scope.changeOpacity = function(){
  
  $scope.app.params.OpacityMI = .5;
};

I then called this function on the 'Pressed' event for the toggle button and was able to see the opacity change. 

image.png

Top Tags