lightbox "X" closes under condition

Sep 14, 2023

Hi, I have a storyline project using lighboxes with different settings. I would like to define when the users are allowed to close it ("X" is functional). Is there any solution to define conditions (e.g. timeline ends, all objects clicked) for the "x"? 

I cannot even see the "x" as an object to the slide.

Any help is welcome.  

kind regards

Monique

3 Replies
Jose Tansengco

Hello Monique, 

Happy to help!

There isn't a way to control the functionality of the 'X' icon that closes a lightbox. One workaround that you can do is to follow the steps shared in this community post to hide the native 'X' icon and then create your own close button using triggers. 

You can define how a learner gets to close a 'Lightbox' by making use of the 'Close lightbox' trigger shown here: 

With this trigger added to the slide, your learners will have more than one option to close the slide which means they don't have to be dependent on the 'X' button to close it.

Hope this helps!

Monique Hempe

Hello Jose, 

sorry for my late response. It took a while to upload a test file on our LMS. The javascript seems to work fine, as no "X" is visible in the upper right corner. However also my own triggers, which should appear when some conditions are met, don't seem to work. For a better insight, I uploaded an example with limited content.

Anything I could do different?

Judy Nollet

Hi, Monique,

Your trigger with conditions on the German Legislation slide doesn't work because that slide also has this trigger: 

  • That prevents the icon from showing. Pictures 2, 3, 4, and 5 will never all be Visited, because Picture 2 goes back to Normal as soon as Pictures 3, 4, and 5 are visited. 
  • Just delete that trigger, and the slide works. 

Also note that you don't need triggers to change the state of those X (close) icons to Hidden when the timeline starts. Instead, just set their initial state to Hidden. 

By the way, I highly recommend that you give every object a meaningful name. That makes it much easier to troubleshoot.