Forum Discussion
Hide default close button in lightbox slide
I am trying to hide the default close button on the lightbox slide. I've been using this javascript that I got from a post from 3 years ago (https://community.articulate.com/discussions/articulate-storyline/default-close-button-of-lightbox).
document.getElementById('light-box-close').style.display = "none";
Previously when I used it, it worked like a charm. Now I cannot get it to work. Thinking maybe something changed with the close button reference ID in the latest update, but not sure.
- MelvinPluijmaekCommunity Member
- AideenGillen-7cCommunity Member
- RichardWatsonSuper Hero
Scott,
Additional information while you wait for someone who can provide an additional perspective.
Richard
====
I tested the following on Edge and Chrome using the latest version of Storyline 360 (modern player), and it still removes the close button on the lightbox slide.
The inspector still shows it as:
document.getElementById("light-box-close").style.display = "none";
/*This code needs to be placed on any slides being Lightboxed
to hide the default close button*/ - BarbaraJacobs-1Community Member
if (document.getElementsByClassName("lightbox-close-btn-floating").length > 0) {
document.getElementsByClassName("lightbox-close-btn-floating")[0].style.display = "none";
} - StephanieSto307Community Member
Hi Barbara. When I use the code above, all the slides are reduced in size after I exit using my own close button. Does that happen to you too?
- BarbaraJacobs-1Community Member
Hi Stephanie. No, I don't have that issue. The boxes open up properly in a lightbox and close properly with a close button (Close Lightbox).
How do we then make the "X" button reappear again?