Controlling the opacity of a group

rbeutel4797
rbeutel4797 Community Member Posts: 13
Does anyone know how to control the opacity of a group?

I would rather not use greensock or similar.

Comments

  • astafford3593
    astafford3593 Community Member Posts: 12
    I think you have to change the opacity on each specific item within the group. There isn't an option to change opacity at the group level in the group properties. Are the grouped items supposed to do something? Like change appearance after some action occurs? I'm curious to how you want to use the group. I use Lectora 17.1.1. Thanks!
  • rbeutel4797
    rbeutel4797 Community Member Posts: 13
    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
  • mallow76
    mallow76 Community Member Posts: 123
    Another option is to cover the group with another object (i.e. a rectangle) and then just change the opacity of that object.
  • astafford3593
    astafford3593 Community Member Posts: 12
    Thank you for sharing your solutions. I've done the same thing that mallow76's done with a different object. I'll have to try the script. Thank you for sharing!