Can the tile color be changed dynamically

Get help with using Metro 4 components
Post Reply
MonkeyDesk
Posts: 1
Joined: Thu May 03, 2018 4:31 am
Status: Offline

Can the tile color be changed dynamically

Post by MonkeyDesk » Thu May 03, 2018 4:38 am

Hello Forum.

I've been having a lot of fun with metroui and was wondering if there is a way to dynamically change the color of a tile in js. Something like this:

if (myObj.onoff == "ON")
{
document.getElementById("tile1").style ="background-color: #4a00b3";
}
else if (myObj.onoff == "OFF")
{
document.getElementById("tile1").style="background-color: #2a50b3";
}

Thanks

User avatar
olton
Site Admin
Posts: 69
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Thu May 03, 2018 10:25 am


Post Reply