Reputation:
is it possible to make delay of slider start... I don't want to slider start immediatly, want it to wait 2 sec before start and then slide.
$(function() {
$('.banner').slick({
autoplay:true,
autoplaySpeed:2000,
centerMode: true,
centerPadding: '50px',
slidesToShow: 1,
speed:2000,
pauseOnFocus: false,
pauseOnHover: false,
pauseOnDotsHover: false,
});
Upvotes: 0
Views: 14015
Reputation: 1212
I think this is a bit of a cleaner solution than above. Making use of the inbuilt play/pause methods in Slick. Taken from here.
var slider = $('.slider');
slider.slick({
autoplay: true,
autoplaySpeed: 1000
}).slick("slickPause");
var initialDelay = 3000;
setTimeout(function() {
slider.slick("slickPlay");
},initialDelay);
Upvotes: 1
Reputation: 3323
If you want this at initial page load then simply use a setTimeout()
function like this,
var count = 0;
setTimeout(()=>{
count = 1;
$('.banner').slick({
autoplay:true,
autoplaySpeed:2000,
centerMode: true,
centerPadding: '50px',
slidesToShow: 1,
speed:2000,
pauseOnFocus: false,
pauseOnHover: false,
pauseOnDotsHover: false,
},2000) // Initialize the amount of time to delay , Its 2seconds currently.
if(count == 1){
$(function() {
$('.banner').slick({
autoplay:true,
autoplaySpeed:2000,
centerMode: true,
centerPadding: '50px',
slidesToShow: 1,
speed:2000,
pauseOnFocus: false,
pauseOnHover: false,
pauseOnDotsHover: false,
});
}
Upvotes: 3
Reputation: 493
just control your speed through speed:2000,
or autoplaySpeed:2000,
this will delay your slider according to the given time
Upvotes: -1