Dynamically Changing CSS Background Image

前端 未结 5 437
余生分开走
余生分开走 2020-12-10 05:11

What I\'m looking for is a way to make my HTML header tag change background images every few seconds. Any solutions are welcome, as long as it is not to complex.

I h

5条回答
  •  生来不讨喜
    2020-12-10 05:22

    It must be late but may help to another one. For this goal in some situations I prefer to use a jquery plugin named tcycle which have only a few lines of code and supports just fade transition, but it works smoothly even with large images.

    Setting up a slideshow with tcycle is easy and even could be done with declarative markup such as

    The trick could be donde using css z-index:-1 for container div and setting width and height to 100%

    Homepage for downloading and check for other examples is Malsup jQuery plugins

提交回复
热议问题