Explore the community Forums Lectora Lectora Questions & Answers Trigger on variable change Reply To: Trigger on variable change

#411931 Score: 0
Profile photo of approg
approg
Member
beginner
intermediate
curious george
wise owl
contributor
friend finder
picture perfect
22 pts
@approg

Instead of using a button I used a small text box that contains just a single space (so that the text box is never visible). The text box is hidden and then I use JavaScript to make it visible and as it shows it triggers an action(s) attached to it.

The text box has a CSS class added to it called “foo” (it doesn’t matter that the associated CSS doesn’t exist.)

The relevant js in the interaction looks like

var p = parent.window,
t = p.document.querySelector(“.foo”);

if (t && t.id && p[t.id + “actionShow”]) {

p[t.id + “actionShow”]();
}