troubleshooting JavaScript gallery
Oct. 14th, 2024 10:11 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
Hello,
smallweb!
I'm hoping you can help me out with this. I use Juicebox [free version] for gallery pages and I've never had much trouble with it… until now. The gallery appeared normal on my old layout but on my new layout, it's oddly squished down.
I've looked through the gallery code and my CSS and I don't see anything that would compress the gallery like that but…?
I would appreciate any suggestions on how to fix it or alternate gallery templates. (I don't want to create a new page for each image so I would prefer something JavaScript-based like I'm currently using.)
Thank you!
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
I'm hoping you can help me out with this. I use Juicebox [free version] for gallery pages and I've never had much trouble with it… until now. The gallery appeared normal on my old layout but on my new layout, it's oddly squished down.
I've looked through the gallery code and my CSS and I don't see anything that would compress the gallery like that but…?
I would appreciate any suggestions on how to fix it or alternate gallery templates. (I don't want to create a new page for each image so I would prefer something JavaScript-based like I'm currently using.)
Thank you!
no subject
Date: 2024-10-14 01:23 am (UTC)Melon's Gallery Maker
no subject
Date: 2024-10-14 02:49 am (UTC)Hi! I tested this out in my browser and some weird stuff happened, but I did get it working.
looks like this is an issue with the embedding height. They have a solution here, asking you to set the height of the containing element: https://www.juicebox.net/support/embedding/#percentage-heights .
so your code currently looks like this:
<div id="juicebox-container"></div>
. what you need to do is put it inside another element, like this:<div class="juicebox-parent"><div id="juicebox-container"></div></div>
And then give juicebox-parent the height you want. eg. put
.juicebox-parent {height: 80vh}
in your css.Strangely, I found vh and em units didn't work as inline styles, but px did. so
<div class="juicebox-parent" style="height:500px">
worked, but<div class="juicebox-parent" style="height:80vh">
didn't. Good luck!no subject
Date: 2024-10-14 05:27 am (UTC)