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.

Fading icon image
#2
One option is to use hue-rotate animation which will recolor your icon. In this case you need to use the same icon for both on/off state (red for this example). Set additional class to recolor

Custom CSS:
Code:
.recolor  {
  transition: filter 3s;
}
.recolor.on {
  filter: hue-rotate(-120deg);
}

Custom JS:
Code:
$(function() {
  $('.recolor').each(function(_, el) {
    var $el = $(el), addr = $el.data('object');
    
    if (addr) {
      grp.listen(addr, function(obj) {
        $el.toggleClass('on', obj.value);
      });
    }
  });
});
Reply


Messages In This Thread
Fading icon image - by Kilogica - 19.08.2022, 08:59
RE: Fading icon image - by admin - 19.08.2022, 09:54
RE: Fading icon image - by Kilogica - 19.08.2022, 10:39

Forum Jump: