M1X
M1X

Reputation: 5374

Auto sliding photos jQuery image slider

I have this script which runs a function when clicking the next arrow to go to the next photo.

<script src="js/jquery.cbpFWSlider.min.js"></script>

How can I make an automatic call to this function or whatever to slide photos?

        $( function() {
            $( '#cbp-fwslider' ).cbpFWSlider( {speed : 1200, easing : 'ease'});
        } );

Also how can I modify the easing : 'ease' param. to other values?

Upvotes: 2

Views: 1803

Answers (3)

Brian Merrell
Brian Merrell

Reputation: 1173

That plugin uses the easing option to apply a CSS3 property "transition-timing-function" to the function. To change the easing value, specify another valid value.

See http://www.w3schools.com/cssref/css3_pr_transition-timing-function.asp as a reference.

Upvotes: 0

user1454373
user1454373

Reputation: 370

This worked for me. You can find the answer here Autoplay JQuery slideshow Using cbpFWSlider

$('document').ready(function(){
                // init slider
                $('#cbp-fwslider').cbpFWSlider();

               /**
                     Set a 3 seconds interval
                     if next button is visible (so is not the last slide)  click next button
                     else it finds first dot and click it to start from the 1st slide
                **/
                setInterval( function(){
                    if($('.cbp-fwnext').is(":visible"))
                        {
                            $('.cbp-fwnext').click();   


                }
                else{
                        $('.cbp-fwdots').find('span').click();
                    }
            } ,3000 );
        });

Upvotes: 1

Fosforus
Fosforus

Reputation: 57

I don't know if this is the most efficient way of getting the result you want, but try using window.setInterval( func, delay ); where delay is in milliseconds.

Upvotes: 0

Related Questions