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 attribute in visu following a knx object
#15
(29.08.2024, 15:49)admin Wrote: It's not working because the previous function in Custom JavaScript fails with an error. Change it to this and it will work:
Code:
$(function(){
  $('.slider-alt').each(function(_, el) {
    var $el = $(el), addr = $el.data('object'), icon = $el.find('.icon');
    if (addr) {
      grp.listen(addr, function(obj) {
        var val = obj.value || false;
        //val = Math.round(2.55 * (100 - val));
        var name = el.getAttribute('data-object-name');
        el.textContent = name
      });
    }
  });
});

Thanks, admin. Problem solved as always Big Grin
Reply


Messages In This Thread
RE: Change attribute in visu following a knx object - by Andrea Becagli - 29.08.2024, 16:15

Forum Jump: