Assign A Style On Condition Possible?

I want to assign a class to a link based on a condition.

i.e. if group A is visible, link class = XXXXXX

Is this not possible or am I missing something right infront of me (again)?

Thanks all and happy NY!

1 Like

Hey @JustinC,

Have you tried tackling this via conditional formatting? Are you trying to make use of CSS classes within Bubble?

:worried:

I have. Have not seen anything.

I am trying to assign a different class to an element when an element is visibile.

These classes are bubble classes.

Not quite sure what you mean by a “class” here ?

What exactly are you trying to do?..you should be able to do all the standard type things using conditional statements.

If you are stepping out of the ‘bubble way’ then you could use jQuery in an html element to search for the element (if you can identify it in some way) and append/remove classes as you see fit.

Similar to the autofill thread, except you are using addClass and removeClass instead of working with parameter/attributes.

Sorry. By Class I mean Style.

My old developer hat is still on!

Trying to change a style of an element based on conditions.

Since styles contain conditions of their own, there’s no method as to changing styles upon a condition. Alternatively, you can utilize the properties you’d like to change in the condition itself. Perhaps you can speed up the process for multiple elements with the same desired condition via the Copy conditional formatting option.

2 Likes

Yeah that I get. It is much easier to conditionally use style A or B though vs. Having to manage every element when a change is made.