Creating a JQuery Slideshow of a Background-Image

前端 未结 2 707
你的背包
你的背包 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: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
    );
    

提交回复
热议问题