[英]How to split the image using Javascript + CSS?
I have the image like this: 我的图像是这样的:
I want to split it into six squares, and I can keep looping to display the animation. 我想把它分成六个方块,我可以继续循环来显示动画。 Do you have any ideas to split the image by JS + CSS instead of using 6 separate image files. 您是否有任何想法通过JS + CSS分割图像而不是使用6个单独的图像文件。
Set it as a background image and manipule the background position. 将其设置为背景图像并操纵背景位置。
Update: As seth mentioned, the technique is called CSS Sprites. 更新:如上所述,该技术称为CSS Sprites。 Searching google for animation with css sprites turns up some good results. 使用css sprites搜索谷歌动画会产生一些好的结果。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.