Animated .GIF vs Spritesheet + JS/CSS

后端 未结 8 492
忘了有多久
忘了有多久 2020-12-23 11:51

Which will scale best for performance, file-size, (and my sanity): Animated .gifs or a spritesheet with animations using CSS (and JS when need be)?

File

8条回答
  •  醉话见心
    2020-12-23 12:26

    One other issue related to CSS sprites, at least in the current browsers, is scaling "jitter". You can scale the GIF file to whatever size you need (presumably smaller), but if you try to scale the CSS sprite you run into jitter because of rounding errors (background-position is based on the the scaled coordinates, not the original). If someone knows another way of handling scaled animated sprites, that would be great to know.

    ImageMagick does a great job of creating animated GIFs or sprites.

提交回复
热议问题