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.

javascript to check css element
#5
If you want to do a kind of AND/OR gate then you need this. Change group addresses as needed and you can change && (AND) to || (OR).
Code:
$(function(){
   var v1 = false, v2 = false;

   function set() {
      $(".hidebyknx").toggleClass("hide", v1 && v2);
   }

   grp.listen('1/1/1', function(object, state) {
      v1 = object.value;
      set();
   }, true);

   grp.listen('1/1/2', function(object, state) {
      v2 = object.value;
      set();
   }, true);
});
Reply


Messages In This Thread
RE: javascript to check css element - by admin - 05.07.2021, 09:27

Forum Jump: