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
#6
(05.07.2021, 09:27)admin Wrote: 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);
});
Yes this is what i am after, works well many thanks, 

Also how can i request the value for both obj on page load? something like the below? grp.write() works for me but not grp.read() also is there a list of functions that are available in the custom js to interact with objects from the vis etc.
Code:
  $(document).ready(function() {
    grp.read('1/1/1')
    grp.read('1/1/2')
   
 });
Reply


Messages In This Thread
RE: javascript to check css element - by benanderson_475 - 08.07.2021, 03:09

Forum Jump: