Changing a visual perspectives background colour dynamically

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
karelh
Posts: 86
Joined: Wed Oct 26, 2016 10:20 pm

Changing a visual perspectives background colour dynamically

Post by karelh »

Hi all,

Hope you are well. We have a customer request where they want to change the background colour for the banner and main section of a visual perspective based on a user's selection. We added a "colour picker" to the system settings and tried to refer to it in the visual perspective CSS as "background-color: <<SystemSettings.colour>>".

After inspecting the css on runtime we can see it just injects the full string as the class instead of resolving the attribute.

Has anyone done this before? Will appreciate any help or direction.

All the best.

Karel
hpl123
Posts: 2594
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Changing a visual perspectives background colour dynamically

Post by hpl123 »

I haven´t done this but you could use a class name for each frame e.g banner, background etc. and then use jQuery to change or add a CSS attribute to the class. I have done other similar things and as this is a dynamic thing you would also have to have some function that runs when displaying the frame to set (re-set) the CSS attribute.

Code: Select all

$( ".frameClass" ).css( "background", "red" );
Henrik (V8 Developer Ed. - Windows)
Post Reply