javascript - Slick 'autoplay' does not starts automatically -
so have site , i'm using slick.js in gallery show images, use angularjs. problem 'autoplay' not triggered when function called when controller loaded site.
// set slick carousel. function setcarousel() { console.log( "carousel started" ); $('.single-item').slick( {, autoplay: true, slide: 'div', autoplayspeed: 2000, dots : true }); };
so function called whenever user selects gallery site controller is:
myapp.controller( 'pagecontroller', ['$scope', '$http', function ($scope, $http ) { setcarousel(); } ] );
remove comma after {
character. should :
$('.single-item').slick({ autoplay: true, slide: 'div', autoplayspeed: 2000, dots : true });
Comments
Post a Comment