在fullPage.js插件中自动播放幻灯片

时间:2022-02-12 22:58:54

How can I implement autoplay for slides if use the fullPage.js plugin?

如果使用fullPage.js插件,如何为幻灯片实现自动播放?

<div id="fullpage">
<div class="section">
  <div class="slide"> Slide 1 </div>
  <div class="slide"> Slide 2 </div>
  <div class="slide"> Slide 3 </div>
</div>
<div class="section">Some section</div>
<div class="section">Some section</div>

1 个解决方案

#1


0  

Open Google and type "autoplay fullpage.js". Click on the first result and follow the instructions:

打开Goog​​le并输入“autoplay fullpage.js”。单击第一个结果并按照说明操作:

$(document).ready(function () {
    $('#fullpage').fullpage({
        afterRender: function () {
            setInterval(function () {
                $.fn.fullpage.moveSlideRight();
            }, 1000);
        }
    });
});

Demo online

#1


0  

Open Google and type "autoplay fullpage.js". Click on the first result and follow the instructions:

打开Goog​​le并输入“autoplay fullpage.js”。单击第一个结果并按照说明操作:

$(document).ready(function () {
    $('#fullpage').fullpage({
        afterRender: function () {
            setInterval(function () {
                $.fn.fullpage.moveSlideRight();
            }, 1000);
        }
    });
});

Demo online