Explore the community Forums Lectora Lectora Questions & Answers Need show/hide option to carry across pages

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #283156 Score: 0
    Profile photo of molynn69
    molynn69
    Member
    @molynn69

    Hi … I am trying to use the show/hide toggle action on a button to display an image. The problem is that I need this image to stay displayed (or hidden) from page to page depending on the user’s selection. How can I accomplish this? The image resets to the hide state (the initial state of the object) on each page load.

    #286730 Score: 0
    Profile photo of AHwalek
    AHwalek
    Member
    beginner
    intermediate
    1 pt
    @AHwalek

    You can do it with variables. Create a variable called ImageOn set it to 0 at start.

    On the page where the image is picked, have an action to show the correct image as well as modify the variable to 1.

    On the proceeding pages have an OnShow action to show the graphic if the variable is 1.

    That should give you the general idea of how to do it.

    #286731 Score: 0
    Profile photo of molynn69
    molynn69
    Member
    @molynn69

    @ahwalek 58558 wrote:

    You can do it with variables. Create a variable called ImageOn set it to 0 at start.

    On the page where the image is picked, have an action to show the correct image as well as modify the variable to 1.

    On the proceeding pages have an OnShow action to show the graphic if the variable is 1.

    That should give you the general idea of how to do it.

    The variables worked! I was struggling with how to make the toggle show/hide work if I set a varibalbe to show if 1 and if the user clicked on the button to trigger the image more than once. I ended up adding more conditions. The image is “off” or hidden if the variable is even and on or “show” if the variable is odd.

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

You must be logged in to reply to this topic.