Hi guys,
i am using this gallery:
This is my current functon to run the slider:
$( function() {
$( '#cbp-fwslider' ).cbpFWSlider();
} );
setInterval(function() {
if(jQuery('.cbp-fwnext').css('display') != 'none'){
jQuery('.cbp-fwnext').click();
}
else jQuery('.cbp-fwdots span:first-child').click();
}, 3000);
How can i make this to be A LOOP to start over again instead of stopping at last image?
Thanks!!!
Hi,
My initial idea would be upon each iteration to check for the end of the slider. When it is reached, simply animate everything back to the beginning. Something like:
$(slider).animate({left: 0})
Hi,
Can you tell me where to add this code?
Hi,
So I just had a look at the slider (probably should’ve done this in the first place) and it appears the code from your original post should work.
You just have to put it all inside $(function(){ ... });
$(function(){
$('#cbp-fwslider').cbpFWSlider();
setInterval(function() {
if($('.cbp-fwnext').css('display') != 'none'){
$('.cbp-fwnext').click();
}
else{
$('.cbp-fwdots span:first-child').click();
}
}, 2000);
});
Here’s a demo .
Hi Pullo,
Thanks for your reply i have added this howver when it is at the last item… it takes AGES before it goes to the first one.
Take a look at demo:
http://onderneemonline.nu/
Speed seems ok for me.
You have a couple of empty ul tags in there though, which might be causing problems:
E.g. line 293, line 305:
<ul>
<li><center></center></li>
</ul>
Also, your HTML is invalid. For example, you are missing the closing </body> tag and closing </html> tag.
See here: http://validator.w3.org/check?uri=http%3A%2F%2Fonderneemonline.nu%2F&charset=(detect+automatically)&doctype=Inline&group=0
system
Closed
May 19, 2015, 4:37pm
7
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.