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.

Symbol gradient
#3
(09.10.2023, 11:37)admin Wrote: Set element's Additional classes to colorize and display mode to either Icon or Icon and value.

Add to Custom CSS to hide the icon image.
Code:
.colorize .icon img {
  visibility: hidden;
}

Add to Custom JavaScript:
Code:
$(function(){
  $('.colorize').each(function(_, el) {
    var $el = $(el), addr = $el.data('object'), icon = $el.find('.icon');
   
    grp.listen(addr, function(obj) {
      var val = obj.value || 0;
      val = Math.round(2.55 * (100 - val));
      icon.css('background-color', 'rgb(' + val + ', 255, ' + val + ')');
    });
  });
});


Hov do I make the square that will show the gradient?
Reply


Messages In This Thread
Symbol gradient - by tomnord - 09.10.2023, 11:13
RE: Symbol gradient - by admin - 09.10.2023, 11:37
RE: Symbol gradient - by tomnord - 10.10.2023, 08:46
RE: Symbol gradient - by admin - 10.10.2023, 08:57

Forum Jump: