views:

20

answers:

1

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!

+1  A: 

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

ocdcoder
Pardon my noobieness, but where in the js file would I put this?
shaiss
you could create a script tag at the bottom of the page the scroller is on
ocdcoder
I tried that, as well as putting it in its own js file and calling it using<script type="text/javascript" src="{$this_path}slider/autoscroll.js"></script> In the same file that slider.js and boot.js are called. Didnt work. I must be missing something simple.
shaiss
maybe #arrow isn't correct, I tried #next and someothers but no luck
shaiss
yea, sorry, '#arrow' is just a placeholder. lemme look at the template and find the actual selector for ya
ocdcoder
try: $('#slides > .next > a')
ocdcoder
Yes, your awesome! Thank you so much for the help!
shaiss
no problem, glad to help!
ocdcoder