My SVG "StateSignal13" is still shown after triggering Bestätigung_ÖFFNET and Bestätigung_SCHLIESSET. Visibility doesn't work at all. What's wrong?
var LE1BO = LeitstandSCHENKERRadeburg.getVariable("Siemens LOGO 8 NR1.Bestätigung_ÖFFNET");
var LE1BS = LeitstandSCHENKERRadeburg.getVariable("Siemens LOGO 8 NR1.Bestätigung_SCHLIESSET");
function ZustandLE1(){
if (LE1BO == "True") {
LeitstandSCHENKERRadeburg.setVariable("Intern.ZustandLE1","True");
LeitstandSCHENKERRadeburg.setProperty("LeitstandSCHENKERRadeburg.StateSignal13.visibility", "visible");
}else {
LeitstandSCHENKERRadeburg.setProperty("LeitstandSCHENKERRadeburg.StateSignal13.visibility", "hidden");
}
if (LE1BS == "True") {
LeitstandSCHENKERRadeburg.setVariable("Intern.ZustandLE1","False");
LeitstandSCHENKERRadeburg.setProperty("LeitstandSCHENKERRadeburg.StateSignal13.visibility", "visible");
}else {
LeitstandSCHENKERRadeburg.setProperty("LeitstandSCHENKERRadeburg.StateSignal13.visibility", "hidden");
}
}
<iframe name="sif1" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>
CodePudding user response:
Not sure what type LeitstandSCHENKERRadeburg
is representing.
But assuming it's an HTML element the setProperty function is not applied correctly.
Take a look at the documentation of it.
If you want to adjust the styling of your element you will need to access it like so:
LeitstandSCHENKERRadeburg.style.setProperty('visibility', 'hidden')