29.09.2021, 07:34
(29.09.2021, 06:12)admin Wrote: 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.
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;
}
});
};
});
great and easy, alternative to creating GIF.
But how to make it depend on the element value (Binary) instead of a specific object?
Best Regards,