This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

change the opacity of a text
#1
hello 
I used this JS code to change the objects to read only and change the opacity, but it didnt change the opacity of a text
how to make it work in text also
Code:
$(function(){
  grp.listen('32/1/1', function(object) {
     if (object.value == true ) {
        $(".lockbyknx").addClass("item-read-only");
         $(".lockbyknx").find('img').css("opacity", 0.5);
     } else if (object.value == false ) {
        $(".lockbyknx").removeClass("item-read-only");
         $(".lockbyknx").find('img').css("opacity", 1);
     }
  }, true); // set to true to send on same value
});
Best Regards,
Reply
#2
Custom JS:
Code:
$(function(){
  grp.listen('32/1/1', function(object) {
    $(".lockbyknx").toggleClass("item-read-only", object.value == true);
  }, true); // set to true to send on same value
});

Custom CSS:
Code:
.item-read-only {
  opacity: 0.5 !important;
}
Reply
#3
Thanks admin
But it changed the opacity of all read only values
I want to change the opacity of values with "lockbyknx"

regards,

edit: I changed the CC
Code:
/* Change Opacity*/
.lockbyknx {
  opacity: 0.3 !important;
}
Best Regards,
Reply
#4
Use this:
Code:
.lockbyknx.item-read-only {
  opacity: 0.5 !important;
}
Reply
#5
(18.11.2021, 12:02)admin Wrote: Use this:
Code:
.lockbyknx.item-read-only {
  opacity: 0.5 !important;
}

thanks admin
Best Regards,
Reply
#6
How can I remove the + and - button from a direct input box ?
Reply
#7
This will hide buttons from all input boxes:
Code:
.control-spinner .btn { display: none; }
Reply


Forum Jump: