Forum Discussion
BorgCube
2 years agoCommunity Member
Working with Javascript triggers - how to find button ID's and Classes (States)?
Hi,
I have a JS-script which should change the state of a button when a user enters a certain code into a text-entry field.
However, I'm unable to find the ID and classes of the button anywhere....
Jürgen_Schoene_
2 years agoCommunity Member
storyline don't use html/css for
- text (static text)
- border (around a text)
every static text in storyline is an embeded svg (grafik)
structur of storyline text in the html output
<div> ['demoText1'] - text box background with html styles (1)
...
<svg> - text with textbox border with svg styles (2)
path -> stroke (corresponds borderColor)
-> fill (corresponds backgroundColor)
text (line 1) -> fill (corresponds color)
text (line 2) -> fill (corresponds color)
...
=> (1) backgroundColor works (but this only works, if there is no background defined in storyline)
=> (2) borderColor and color do not work at all
here are example scripts to modify svg textColor, borderColor and backgroundColor
// textColor (multiline)
var myText = document.querySelectorAll("[data-acc-text='demoText3'] text");
myText.forEach((x, i) => x.setAttribute("fill", "green" ))
// borderColor
var myElement = document.querySelector("[data-acc-text='demoText3'] path");
myElement.setAttribute("stroke", "blue" )
// backgroundColor (width/height matches with the border)
var myElement = document.querySelector("[data-acc-text='demoText3'] path");
myElement.setAttribute("fill", "red" )
Related Content
- 7 months ago