Explore the community Forums Lectora Lectora Questions & Answers Controlling the opacity of a group Reply To: Controlling the opacity of a group

#381871 Score: 0
Profile photo of Robert Beutel
Robert Beutel
Member
beginner
intermediate
friend finder
curious george
wise owl
contributor
1 pt
@rbeutel4797

I have resorted to using the following:

// Grab the set opacity from a lectora variable so I can change the value if needed
var elementOpacity = Var_opacityElement.getValue();

// Apply the set opacity to all elements within the group
var elementBtn = document.getElementById(‘shape520513’);  // First element in group
elementBtn.style.opacity = elementOpacity;
elementBtn.style.filter  = ‘alpha(opacity=’+(elementOpacity*100)+’)’;  // IE fallback

var elementOutline = document.getElementById(‘shape520546’);  // Second element in group
elementOutline.style.opacity = elementOpacity;
elementOutline.style.filter = ‘alpha(opacity=’+(elementOpacity*100)+’)’;  // IE fallback

var elementIndicator = document.getElementById(‘shape520573’);  // Third element in group
elementIndicator.style.opacity = elementOpacity;
elementIndicator.style.filter = ‘alpha(opacity=’+(elementOpacity*100)+’)’;  // IE fallback