0

Using this lazy-loading code, my lightbox breaks: clicking on an image shows the lightbox but without image.

I can see that the lightbox img tag has no src value by checking the inspector. I guess the lightbox checks the src before the lazy-loading has assigned the attribute and the value to the image.

How can I fix this issue?

1
  • can you share some code it's hard to tell what's going on without observing Commented Aug 28, 2019 at 10:41

1 Answer 1

2

You may be able to use the data-fullsize parameter mentioned in the documentation - if this is set on each <img> tag, they should be loaded when the gallery is opened.

An example of how this might look in the HTML (with the lazy-loading example from the link you provided):

<img data-lazy="img/cow.jpeg" data-fullsize="img/cow.jpeg">
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.