21.06.2022, 14:27
JavaScript:
CSS:
Use additional class off-1, off-2, etc up to off-50. Objects start with 1/1/1 up to 1/1/50.
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.