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
#6
JavaScript:
Code:
$(function(){
  if (window.grp) {
    function listen(i) {
      grp.listen('1/1/' + i, function(object) {
        $('.off-' + i).toggleClass('off', object.value == false);
      });
    }
    
    for (var i = 1; i <= 50; i++) {
      listen(i);
    }
  }
});

CSS:
Code:
.off {
  pointer-events: none;
}
.off .icon {
  background-image: url('/scada/resources/icons/control-stop.svg');
  background-size: 100%;
}
.off .icon img {
  visibility: hidden;
}

Use additional class off-1, off-2, etc up to off-50. Objects start with 1/1/1 up to 1/1/50.
Reply


Messages In This Thread
RE: change icon based on another object - by admin - 21.06.2022, 14:27

Forum Jump: