Creating a JQuery Slideshow of a Background-Image

前端 未结 2 682
你的背包
你的背包 2021-01-27 05:21

I have an element that serves as the banner on my website. This banner has HTML content on it, but uses a high-resolution picture as the background-image. Because of this, I\'m

相关标签:
2条回答
  • 2021-01-27 06:14
    • DEMO: http://so.devilmaycode.it/creating-a-jquery-slideshow-of-a-background-image

    look the demo source for the full working code

    0 讨论(0)
  • 2021-01-27 06:15

    Basically use setInterval to call loadBGImage, say every 60 seconds.

    e.g. something like

    var interval = 0;
    var intervalTimer = setInterval(
        function(){
            if (++interval > 10) {interval = 1}
            $("#bannerTable").loadBGImage("/picture" + interval + ".png");
        }
        ,
        60000
    );
    
    0 讨论(0)
提交回复
热议问题