display
or visibility
. Don't breath. You can only change transform
and opacity
. Delay all your changes after animation ends – use events: beforeChange
(slide switched), initialZoomInEnd
(initial zoom in animation ended) and initialZoomOutEnd
(initial zoom out animation ended).:hover
and :active
effects on thumbnails that open PhotoSwipe if you have zoom-in/out animation enabled (apply the first rule). text-shadow
on caption text can cause issues.If you followed above steps and performance of your gallery differs from PhotoSwipe home page, start isolating PhotoSwipe on page by excluding all JS/CSS/HTML code not related to it. Make sure that you don't have any kind of banner rotators that continuously run some animation behind the PhotoSwipe.
If it doesn't work fast even after you isolated PhotoSwipe – open an issue on GitHub and provide a link to reduced test case.
png
and svg
sprite. By default, it's loaded only after PhotoSwipe is opened. To make controls appear instantly, you may merge gallery sprite with your site "main" sprite, or preload it via CSS.Know how this page can be improved? Suggest an edit!
</> with <3 in by @dimsemenov