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.

Text over background
#3
(31.10.2022, 07:13)admin Wrote: Try adding z-index: 1 !important; to .item-bgm styles.

It works, thanks a lot, 

I'm changing the background color of the .item-bgm style with this JS 
Code:
$(function() {
  $('.item-bgm').each(function(_, el) {
    var addr = $(el).data('object');
    if (addr) {
      grp.listen(addr, function(obj) {
        var value = obj.value
          , background = 'repeating-radial-gradient(red, transparent 150px)'; // default color

        if (value > 0 && value < 20 ) {
          background = 'repeating-radial-gradient(#0CAFFF, transparent 150px)';
        }
        else if (value >= 20 && value <= 23) {
          background = 'repeating-radial-gradient(#1DB954, transparent 150px)';
        }
        else if (value > 23 && value < 99) {
          background = 'repeating-radial-gradient(#7C0A02, transparent 150px)';
        }

        $(el).css('background', background);
      });
    }
  });
});
I want to know if it is possible to change the border color of the css style depending on the mode of the thermostat,
Heating Value - 1byte object 
Cooling Value - 1byte object 
If heating > 0 then
border: 2px solid red
else if
cooling > 0 then 
border: 2px solid blue 
else if cooling == 0 and heating == 0 then 
border: 2px solid white

(31.10.2022, 07:33)Fahd Wrote:
(31.10.2022, 07:13)admin Wrote: Try adding z-index: 1 !important; to .item-bgm styles.

It works, thanks a lot, 

I'm changing the background color of the .item-bgm style with this JS 
Code:
$(function() {
  $('.item-bgm').each(function(_, el) {
    var addr = $(el).data('object');
    if (addr) {
      grp.listen(addr, function(obj) {
        var value = obj.value
          , background = 'repeating-radial-gradient(red, transparent 150px)'; // default color

        if (value > 0 && value < 20 ) {
          background = 'repeating-radial-gradient(#0CAFFF, transparent 150px)';
        }
        else if (value >= 20 && value <= 23) {
          background = 'repeating-radial-gradient(#1DB954, transparent 150px)';
        }
        else if (value > 23 && value < 99) {
          background = 'repeating-radial-gradient(#7C0A02, transparent 150px)';
        }

        $(el).css('background', background);
      });
    }
  });
});
I want to know if it is possible to change the border color of the css style depending on the mode of the thermostat,
Heating Value - 1byte object 
Cooling Value - 1byte object 
If heating > 0 then
border: 2px solid red
else if
cooling > 0 then 
border: 2px solid blue 
else if cooling == 0 and heating == 0 then 
border: 2px solid white

When I click on the temp it will display a widget.
The heating and cooing values are on the widget

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
Text over background - by Fahd - 28.10.2022, 06:10
RE: Text over background - by admin - 31.10.2022, 07:13
RE: Text over background - by Fahd - 31.10.2022, 07:33
RE: Text over background - by admin - 31.10.2022, 12:06
RE: Text over background - by Fahd - 31.10.2022, 12:11
RE: Text over background - by admin - 31.10.2022, 13:22
RE: Text over background - by Fahd - 31.10.2022, 13:45

Forum Jump: