klc01
-
Posts
4 -
Joined
-
Last visited
Content Type
Forums
Gallery
Blogs
Events
Store
Downloads
Profiles
Posts posted by klc01
-
-
I'm using the Lightbox Anything plugin from Sqsp Themes to play a collection of audio files.Â
My issue is on mobile. I. using a script found in the Forum to allowed the audio file to play in the same page on mobile, but when I close the lightbox, the audio continues to play. Desktop is fine.Â
Site:Â whalingcommonground-cms.squarespace.com/stories-from-the-collectionÂ
Pass: nbwm2022This is the thread where I found the audio code, followed by the specific code I'm using. There are two other codes offered within this thread, but they also result in the audio continuing to play.Â
Can anyone provide some assistance to end the audio when the lightbox is closed?Â
Thank you!
-
-
I'm having a similar issue: I can apply the translation dropdown and it does work, but it fluctuates with the navigation bar or falls behind it. On desktop with an announcement banner, it falls behind the bar. With a bar or without look equally terrible on mobile. I'd like to place the translation function above the navigation bar and/or the announcement bar, I just can't get it to stay put.
Can you help? Â
https://kitchenworkfoundation-cms.squarespace.com/Â
password: kwf2022
Audio File in Lightbox on Mobile, Keeps Playing After File Closed
in Customize with code
Posted
The developer shared this fix and I'm posting here in case anyone finds it helpful. Instructions were to place this before the plugin code. 🙂
<script>
function lightboxStopAudioPlayer() {
const button = document.querySelector('.c-lightbox__close');
const stage = document.querySelector('.c-lightbox__stage');
function pause() {
const pauseButton = document.querySelector('.c-lightbox .pause-button');
if (pauseButton)Â pauseButton.click();
}
button.addEventListener('click',pause);
stage.addEventListener('click',pause);
}
</script>
<div data-lightbox-code-injection>
<script>setTimeout(lightboxStopAudioPlayer, 1000)</script>
</div>
Â