开发者

Adding a timer to existing JS slider

开发者 https://www.devze.com 2022-12-22 23:59 出处:网络
Hoping someone can point me in the right direction. I\'m building a online shop for a client and am using the PrestaShop Moon theme (link).You\'ll notice in the demo that there is a slider.However, th

Hoping someone can point me in the right direction.

I'm building a online shop for a client and am using the PrestaShop Moon theme (link). You'll notice in the demo that there is a slider. However, the slider doesn't change automatically every few seconds like some sliders out there (for example this one). The Moon theme uses an old slider created by Brian Reindel which is no longer supported.

The themes slider also calls boot.js which only includes.

$(function() {

    $( "#slides" ).accessNews({
        speed : "normal",
        slideBy : 1
    });


});

So my question is taking the existing .开发者_开发百科js can it be modified to auto-slide?

Thank you everyone for your help!


Yes, just set an interval and invoke the "click" event on the arrow that scrolls. It should look something like the following:


function makeScroll() {
 $('#arrow').click();
}

setInterval(makeScroll, secs*1000);

where secs is the num of secs you want delayed

0

精彩评论

暂无评论...
验证码 换一张
取 消