I am creating a parallax scrolling website (not all of us) that, among other things, displays an image when the user scrolls.
I did an expansion by putting the image in the background and placing a solid filled div on it. Then I will animate this div from 100% height to 0% height depending on the scroll position, thereby displaying a background image.
I do this several times, and unfortunately I am slowing down.
Using the Chrome’s built-in timeline function, I see that most of this slowdown comes from decoding images. For the above, it re-decodes the image every frame, which takes 22 ms per image per frame.
Does anyone know when a browser should do Image Decode, and when not? It seems to me that I would need it if I resized the image, but not the way I need it, when I only half-fit the image?
Thank you for your help.
source share