#lunbo{
width: 1226px;
height: 460px;
/*background: url(imgs/lunbo1.jpg);*/
animation: 16s lunbo ease-in infinite;
}
@keyframes lunbo{
0%{background: url(imgs/lunbo1.jpg);}
25%{background: url(imgs/lunbo2.jpg);}
50%{background: url(imgs/lunbo3.jpg);}
75%{background: url(imgs/lunbo4.jpg);}
100%{background: url(imgs/lunbo5.jpg);}
}
First of all, you must understand why it flashes, because 0% and 100% will transition immediately in the case of infinite. There is no transition effect between the fifth and first pictures, so you need to change it like this
Damn, there is such a method. In the future, we will use this method for carousel images that cannot be clicked
Css is really convenient to write carousels. JQ also needs to control a marginLeft attribute simply. I accepted this css method. Thank you, host
This method of switching multiple images can be combined into a sprite image, and then used to complete the frame-by-frame animation of CSS3
Frame-by-frame animation of CSS3 animation
I’m going to experiment