345
Views
3
Comments
Change color dyanamic
Application Type
Mobile

Hi All,

I have list of card and when i click particular card than background of particular card will change .

can you please suggest any idea???

is it possible by css or write some Js code??

Thanks

UserImage.jpg
Accelance Partners

@MD Mansur
Yes. It can be done using both CSS and Js. for that, you can use the events 


Thanks 

Shriyash

2019-09-09 12-23-19
Tyler Cools

Hi @Md Mansur,

What you can do, is you can create for instance a local variable in which you can store the color title. Then when you perform the action which causes the color to change you can change this local variable. What you then can do, is use this local variable in the "style classes" property of the container or expression that you want the color to change of. You can make for example different classes in your stylesheet;

red_container{
background-color: red;
}

blue_container{
background-color: blue;
}

If you then, in the style class of the container that you want to change the color of do: 

LocalVariable + "_container", the style class will change when you change the local variable. 

I hope this helps!

Kind regards,

Tyler

2023-11-22 10-51-50
Jozy Sohail

hi @MD Mansur , you can use the style property to change color dynamically, with some conditions.

I'm attaching an OML for better understanding, just refer the icon screen.

Hope it helps,

Regards,

Jozy.

DynamicColor.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.