CSS3 background image transition

前端 未结 13 2190
梦如初夏
梦如初夏 2020-11-22 07:07

I\'m trying to make a \"fade-in fade-out\" effect using the CSS transition. But I can\'t get this to work with the background image...

The CSS:



        
13条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 07:34

    I was struggling with this for a bit, I first used a stack of images on top of each other and every three seconds, I was trying to animate to the next image in the stack and throwing the current image to the bottom of the stack. At the same time I was using animations as shown above. I couldn't get it to work for the life of me.

    You can use this library which allows for **dynamically-resized, slideshow-capable background image ** using jquery-backstretch.

    https://github.com/jquery-backstretch/jquery-backstretch

提交回复
热议问题