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

Tagged: , ,

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #381791 Score: 0
    Profile photo of Robert Beutel
    Robert Beutel
    Member
    beginner
    intermediate
    friend finder
    curious george
    wise owl
    contributor
    1 pt
    @rbeutel4797

    Does anyone know how to control the opacity of a group?

    I would rather not use greensock or similar.

    #381860 Score: 0
    Profile photo of Abby Stafford
    Abby Stafford
    Member
    beginner
    intermediate
    advanced
    verified member
    profile
    curious george
    wise owl
    contributor
    picture perfect
    friend finder
    @astafford3593

    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!

    #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

    #381880 Score: 0
    Profile photo of mallow76
    mallow76
    Member
    beginner
    intermediate
    contributor
    wise owl
    curious george
    23 pts
    @mallow76

    Another option is to cover the group with another object (i.e. a rectangle) and then just change the opacity of that object.

    #381921 Score: 0
    Profile photo of Abby Stafford
    Abby Stafford
    Member
    beginner
    intermediate
    advanced
    verified member
    profile
    curious george
    wise owl
    contributor
    picture perfect
    friend finder
    @astafford3593

    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!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.