29.09.2021, 06:12
Animated GIF is an easy solution.
This can also be achieved with Custom JavaScript. This example will show/hide all elements with additional class set to alert every second when 0/1/24 value is set to true. You can also change $('.alert').removeClass('hide'); to $('.alert').addClass('hide'); to hide the element when the object value is false.
This can also be achieved with Custom JavaScript. This example will show/hide all elements with additional class set to alert every second when 0/1/24 value is set to true. You can also change $('.alert').removeClass('hide'); to $('.alert').addClass('hide'); to hide the element when the object value is false.
Code:
$(function(){
if (window.grp) {
var timer;
grp.listen('0/1/24', function(object) {
if (object.value) {
if (!timer) {
timer = setInterval(function() {
$('.alert').toggleClass('hide');
}, 1000);
}
}
else {
$('.alert').removeClass('hide');
clearInterval(timer);
timer = null;
}
});
};
});