-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid dimensions only calculated on window resize #81
Comments
Confirm the same problem.
|
You could try running the recalculate event on each image load; the issue seems to be if an image has failed to load (or if it does it too quick) then it can cause issues with the event finishing you can try doing it like so here:
|
Hi @richardpbull adding the recalculate event didn't fixed the issue, the problem was that if no src is present on each image macy.js fails to give a correct height, and unless you resize the windows the grid will be shown has previously captured. |
same issue, src is present in all images |
Dirty Fix:
|
This dirty code didn't work for me. I fixed it by setTimeout function. Whenever I'm fetching the images and got the response after I setTimeout with 1 sec and define macy instance in setTimeout function. You can try also. |
Setting |
I had this issue as well, and in my case, it happened because I was using VUE. Whenever I added new elements to the grid or tried to use the The only solution that worked for me was to create a reference (ref) for the grid element I was using and then use this ref as the key for the grid. Every time I called the I believe if you're using this library with a framework like Vue or React, the same thing might be happening. With React, I think the solution to the problem would be the same. |
Hello,
I must be doing something wrong as everywhere else I read about this it is working perfectly.
I can't get the instance to resize on all images loading.
The images remain overlapped until I resize the browser. Video below:
gallery.resize.mov
Here's the code being used on this example: https://www.ultratourmonterosa.com/gallery/
Help appreciated!
Thank you.
The text was updated successfully, but these errors were encountered: