show value in div with image every 10 seconds

0

I would like to achieve 2 questions, the first is that I have an image inside a div, that simulates a little light, the idea is that depending on the number of records in a table I show the image and over it the number. I use a function to bring the value from a php but for some reason it erases the image and does not overlap the value.

The second is that I would like the image, which is like a light green button, to flicker or switch to a lighter color when the value obtained is greater than zero, which is convenient for me? I copy the code:

    function actualizar(){
    $('#sensor').fadeOut("slow").load('prueba1.php').fadeIn("slow");
    }
    setInterval( "actualizar()", 10000 );
  #sensor {
    position: absolute;
    overflow: hidden;
    top: 40px;
    z-index: 29999;
  }

  #luxecita {
    font-size: 20px;
    font-weight: bold;
    color: white;
    z-index: 30000;
  }
<div id="sensor"><img id="luxecita" style="width:65px; height:65px;" src="img/alerta_green.png"/></div>

Sorry for the mistakes, but I'm still learning.

    
asked by look68 12.09.2018 в 17:38
source

1 answer

0

basically, testing and rereading, I got what I needed. Calculation can be made simpler, but I changed the following and I can visualize what I needed:

  #contiene_sensor {
    position: absolute;
    text-align: center;
    overflow: hidden;
    top: 10px;
    right: 320px;
    width: 80px;
    height: 80px;
    z-index: 29999;
  }

#sensor {
    position: relative;
    line-height: 80px;
    display: block;
    top: -82px;
    left: -2px;
    margin: 0 auto;
    max-width: 40px;
    font-family: "Arial Black", bold;
    color:white;
    font-size: 26px;
    text-shadow: -1px 4px 29px rgba(150, 150, 150, 1);
    z-index: 30001;
}

  #luxecita {
    z-index: 30000;
  }
<div id="contiene_sensor" class="animated flash" ><img id="luxecita" style="width:80px; height:80px;" src="img/alerta_green.png"/><span id="sensor"></span></div>

Thanks equally for the collaborations

    
answered by 12.09.2018 в 20:49