Skip to main content
1-Visitor
July 11, 2018
Solved

how to bind button with opacity?

  • July 11, 2018
  • 1 reply
  • 3474 views

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)

Best answer by M_shah

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 

1 reply

15-Moonstone
July 11, 2018

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

 

M_shah1-VisitorAuthorAnswer
1-Visitor
July 11, 2018

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 

15-Moonstone
July 11, 2018

 

you have wrong into the code...

 

change 

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

 

with

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

 

🙂

Bye

Giuseppe