12.02.2023, 18:04
Hi.
Im trying to use this code:
to toggle a css class. For value 1 i would like to set css class f.e. class_for_1 with parameter filter: drop-shadow (x1, y1, b1, c1), if value is 0 class should be changed to class_for_0 with parameter filter: drop-shadow (x2, y2, b2, c2). It's working only for value=1. Please help.
Thanks
Im trying to use this code:
Code:
$(function() {
$('.java_test').each(function(_, el) {
var addr = $(el).data('object');
if (addr) {
grp.listen(addr, function(obj) {
var color_1;
if (obj.value) {
color_1 = 'red';
}
else {
color_1 = 'Green';
}
$(el).css('color_1',obj.value).toggleClass('class_for_1', obj.value);
});
}
});
});
Thanks