johnpoint

johnpoint

(。・∀・)ノ゙嗨
github

Fixing lag in full-screen background image

After replacing the theme (the one I'm currently using), I noticed that the homepage was very laggy when scrolling, but there was no frame drop when scrolling in sections without background images, so I determined that the issue was with the background images.

However, after removing the "fixed" attribute, the lag disappeared, leading me to conclude that this attribute was causing performance issues when scrolling through the blog.

I found this article Fixed background image performance issue and followed the instructions to set the background as a pseudo-element. This prevented frequent repainting of the background during scrolling, thus resolving the frame drop issue. Finally, after half a year of procrastination, my blog homepage is smooth again...

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.