Pointer-events:none or yes depending on value of a toggle button

Hi,

Sorry if the question has already been asked,

I have a fader non-reactive to prevent mishandling with css :
.fader {
pointer-events:none;
}
But sometimes i need to change its value,
Is there a possibility to make it active by pressing a toggle button and make it inactive by pressing again this button ?

Thank’s in advance

D

Yes it’s possible using the advanced property syntax:

.fader {
JS{{
  // @{toggle_id} returns the value of the widget with id "toggle_id"
  // and updates automatically
  if (@{toggle_id} == 0) return "pointer-events:none;"
}}
}

Super :slight_smile:

I’m not familiar with coding
Thank’s for your time Jean Emmanuel

Have a good day

D