mfg92/hugo-shortcode-gallery

Gallery does not load for the first time and images do not align properly

Closed this issue · 4 comments

dzyla commented

Hi,

First of all, I wanted to thank you for this amazing gallery! It works great and looks amazing.

I am using it as the default gallery on my website (www.dzyla.com). I noticed that when I am using it on my portfolio, images do not load at first and the website has to be reloaded. I am not sure what is causing it.

Another issue I noticed is that the image that is lower at the website is clicked, it is not centered properly in the lightbox. However, when the lightbox starts with the images at the top, everything works well.

Both issues are related to the full page gallery that is initialized with:

{{< gallery match="images/*" sortOrder="desc" rowHeight="300" margins="10" resizeOptions="600x600 q95 Lanczos" showExif=true previewType="color" embedPreview="false" >}}

I hope it can be easily fixed!
Thanks!

mfg92 commented

Hi dzyla,

sorry for the late response, but I was on vacation.

I was not able to observe/reproduce both of your issues on your website.
So have you already been able to solve them? If so, what was the cause and how did you solve it?

BR
Matze

dzyla commented

Hi @mfg92! Thanks for the reply. It sometimes happens when the website is freshly loaded (shift+F5, attached). However, when the image is clicked, it opens as just an image, not a lightbox. Going back refreshes fixes the issue. I am using the latest Firefox, but could reproduce it also in Chrome and Edge. Mobile devices seem to work well.
image

The other issue happens much more rarely, and I also cannot reproduce it.

If you have any suggestions, I'd be grateful!

mfg92 commented

So the problem seems to be that the method that initializes the lazy load functionality and the light box is never called.

I guess I made the same mistake as the guy from here.

I have ceated a new branch fix_25 to fix that, can you check if that solves your problem?

dzyla commented

Ha! It works like a charm! Thanks a lot! I will need to learn more javascript soon to understand what's going on there. Anyway, thanks for checking and fixing it!