08-30-2022 10:47 - edited 08-30-2022 11:59
08-30-2022 10:47 - edited 08-30-2022 11:59
Hi, I'm having a groupElement of lines, planing to have different style attributes for active/passive.
I probably could change their class by having different groupElements for each state and dynamically change the members...
But before I try that approach - is there a directer way like .toggle() or something similar?
Answered! Go to the Best Answer.
Best Answer08-30-2022 14:06
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
08-30-2022 14:06
This may help. Beware inconsistency between 'className' and '.class'.
I think I did some messing around with .class in widget-factory.
08-30-2022 13:10
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
08-30-2022 13:10
While I don't fully understand, you can change an element's .class at runtime. You could add or remove class names to that string and, in theory, the relevant styles would be displayed.
Best Answer08-30-2022 13:56
08-30-2022 13:56
hmmm... ok. I hoped so, but don't find the syntax. (I never had used classList so far and it doesn't seem to be supported?)
To explain better: I have a couple of lines and want them to have multiple classes (active passive) with different styles.
Then I want to switch the applied class (style) for some elements, but not for all (Instead of having 2 layers for bg and progress using just one )
Unfortunately I can't test in sim. It doesn't seem to take the changes I make
Best Answer08-30-2022 14:06
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
08-30-2022 14:06
This may help. Beware inconsistency between 'className' and '.class'.
I think I did some messing around with .class in widget-factory.
08-30-2022 14:12
08-30-2022 14:12
oh great! yes!! that's exactly what I was looking for 😊
Need to have another look at the factory then... I'm so out of...