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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

how to bind button with opacity?

M_shah
10-Marble

how to bind button with opacity?

How to bind button in such a way that when i click button the opacity of model will change to one?(Initially i set opacity to zero)

ACCEPTED SOLUTION

Accepted Solutions

Hi @Giuseppe_Fiore 

thank for your concern ... I have followed same steps but after clicking in preview it is not showing the model with opacity 1 

View solution in original post

4 REPLIES 4

hi,

 

you can use this code Javascript:

 

 

$scope.opacity=function(status) {
$scope.view.wdg['IdObject']['opacity'] = status;
};

 

idObject as the id of the widget .

status is the value of opacity.

 

example :

if your widget has an id called    test   :

$scope.opacity=function(status) {
$scope.view.wdg['test']['opacity'] = status;
};

 

if you want  opacity 0 

call    into  event of button    :    opacity(0)

 

if you want  opacity 1

call    into  event of button     :   opacity(1)

 

 

I hope to be proved helpful.

Giuseppe

 

Hi @Giuseppe_Fiore 

thank for your concern ... I have followed same steps but after clicking in preview it is not showing the model with opacity 1 

 

you have wrong into the code...

 

change 

 $scope.view.wdg['test']['opacity'] = status;

 

with

 $scope.view.wdg['model-1']['opacity'] = status;

 

🙂

Bye

Giuseppe

 

 

 

thank you so much @Giuseppe_Fiore

 

Announcements

Top Tags