This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

change icon based on another object
#2
Custom JS - adds off class to <body> element when 1/1/1 is off.
Code:
$(function(){
  if (window.grp) {
    grp.listen('1/1/1', function(object) {
      $('body').toggleClass('off', object.value == false);
    });
  }
});

Custom CSS - applies to additional class global-off. When <body> element has off class it hides the icon image and sets the background image to a custom icon (change URL as needed).
Code:
body.off .global-off .icon {
  background-image: url('/scada/resources/icons/control-stop.svg');
}
body.off .global-off .icon img {
  visibility: hidden;
}
Reply


Messages In This Thread
RE: change icon based on another object - by admin - 15.06.2022, 10:31

Forum Jump: