'Zoom' animation, but 'fade' animation for thumbnails not visible on the page #2129
MentalGear
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While the zoom animations are absolutely great, it always bugged me how the zoom out also happens for thumbnails that are not visible on the page any more. The default zoom-out animation in the lightbox can look glitchy if the thumbnail element is no longer visible on the page. This behavior happens because the zoom-out animation tries to target thumbnails that may have scrolled out of view.
This code example modifies the close behavior: if the thumbnail element is not visible on the page, the lightbox will fade out smoothly instead of zooming out.
Code (with help from chatGPT/perplexity)
Demo: https://jsfiddle.net/ndc95gr4/2/
Beta Was this translation helpful? Give feedback.
All reactions