05.07.2021, 06:17
I have some simple JavaScript to hide/show images based on group address,
how can i check css element before making next change like the below.
Many Thanks
how can i check css element before making next change like the below.
Many Thanks
Code:
$(function(){
grp.listen('1/1/1', function(object, state) {
if (state == 'value' && object.value == true) {
//Check if css element .hidebyknx is shown then continue
$(".hidebyknx").addClass("hide");
} else if (state == 'value' && object.value == false) {
$(".hidebyknx").removeClass("hide");
}
}, true);
});