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.

grp.listen init, value
#5
(09.12.2020, 09:28)admin Wrote: Add a third argument (true) to grp.listen to catch all messages. You also need to clear the timeout on each value update otherwise your function won't work correctly.
Code:
$(function() {
  var timeout;
  grp.listen("33/1/255", function(object,state) {
    if (state == 'value') {
      console.log('Show message');
      clearTimeout(timeout);
      timeout = setTimeout(function(){
       console.log('Hide Messase');
      }, 4500);
    }
  }, true);
});

Ok Thanks!
Reply


Messages In This Thread
grp.listen init, value - by buuuudzik - 06.11.2019, 23:14
RE: grp.listen init, value - by admin - 08.11.2019, 07:44
RE: grp.listen init, value - by DGrandes - 09.12.2020, 09:21
RE: grp.listen init, value - by admin - 09.12.2020, 09:28
RE: grp.listen init, value - by DGrandes - 09.12.2020, 10:03

Forum Jump: