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.

Change Background Image On Object Value
#3
Hello Daniel.

I have done this and works but if I refresh the page the background image is lost. Is there a solution to this?

Code:
$(function(){
  if (typeof grp != 'undefined') {
    grp.listen('32/1/4', function(object, state) {
      var image = $('.hvac_image')[0]
      if (state == 'value') {
        if (object.value == 1) {image.innerHTML = '<img src="scada/resources/img/HVACFlowDiagram1.PNG?1569506491">';}
        else if (object.value == 2) {image.innerHTML = '<img src="scada/resources/img/HVACFlowDiagram2.PNG?1569506498">';}
        else if (object.value == 3) {image.innerHTML = '<img src="scada/resources/img/HVACFlowDiagram3.PNG?1569506503">';}
        else if (object.value == 4) {image.innerHTML = '<img src="scada/resources/img/HVACFlowDiagram4.PNG?1569506509">';}
        }
    });
  }
});


Thanks for your help.
Reply


Messages In This Thread
RE: Change Background Image On Object Value - by manos@dynamitec - 26.09.2019, 17:57

Forum Jump: