Page 1 sur 1

Remplacer un nombre par une image

Posté : 13 mars 2017, 23:42
par team18fr
Salut je suis en train de modifier un widget pour un thermostat et la je voudrais que la température qui se trouve au milieu disparaisse pour laisser la place à une image

Code : Tout sélectionner

</div> <Center> <div class="cmd cmd-widget" data-type="action" data-subtype="slider" data-cmd_id="#thermostat_cmd_id#" style="width : 150px;height : 120px;display : block;"> <span class="pull-left iconCmd#thermostat_cmd_id#" style="position : relative;font-size: 5.5em;"></span> <div> <div style="margin-top : 5px;" > <input type="text" class="dial" data-role="none" value="#order#" data-width="100" data-height="100" /> <i class="fa fa-power-off power-off cursor" style="font-size: 2em; margin-left: 15px; margin-top : -15px; color:#3498db"></i> </div> <div style="font-weight:bold; position: relative; top: -25px; left : 50px;"></br> °C </div> <script> $.include(['plugins/nest/core/template/dashboard/jquery.knob.js'], function () { $(".eqLogic[data-eqLogic_uid=#uid#] .cmd[data-cmd_id=#thermostat_cmd_id#] .dial").knob({ step: 0.5, bgColor: "#3498db", fgColor: "#ffffff", noScroll: true, release: function (v) { jeedom.cmd.execute({id: '#thermostat_cmd_id#', value: {slider: v}}); }, draw: function () { setTimeout(function () { $(".cmd[data-cmd_id=#id#] .dial").css('margin-top', '0px'); setTimeout(function () { $(".cmd[data-cmd_id=#id#] .dial").css('margin-top', '33px'); }, 100); }, 200); } }); if ('#heat#' == '1') { $('.eqLogic[data-eqLogic_uid=#uid#] .iconCmd#thermostat_cmd_id#').css('color', '#FF9900'); } else { $('.eqLogic[data-eqLogic_uid=#uid#] .iconCmd#thermostat_cmd_id#').css('color', 'white'); } if (parseInt('#order#') > 21) { $('.eqLogic[data-eqLogic_uid=#uid#] .iconCmd#thermostat_cmd_id#').append('<i class="icon jeedom-thermo-chaud"></i>'); } else if (parseInt('#order#') >= 19) { $('.eqLogic[data-eqLogic_uid=#uid#] .iconCmd#thermostat_cmd_id#').append('<i class="icon jeedom-thermo-moyen"></i>'); } else { $('.eqLogic[data-eqLogic_uid=#uid#] .iconCmd#thermostat_cmd_id#').append('<i class="icon jeedom-thermo-froid"></i>'); } }); </script>
#order# est la valeur de la température et power-off l'image donc j'arrive à faire disparaître la température et apparaître l'image mais impossible de mettre l'image dans le rond bleu.

Image

Image

Re: Remplacer un nombre par une image

Posté : 15 mars 2017, 16:45
par team18fr
C'est bon j'ai trouvé cela venait des positions mal mis en relative et absolute.