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.
JavaScript
x
13
13
1
$(function() {
2
$('.banner').slick({
3
autoplay:true,
4
autoplaySpeed:2000,
5
centerMode: true,
6
centerPadding: '50px',
7
slidesToShow: 1,
8
speed:2000,
9
pauseOnFocus: false,
10
pauseOnHover: false,
11
pauseOnDotsHover: false,
12
});
13
Advertisement
Answer
If you want this at initial page load then simply use a setTimeout()
function like this,
JavaScript
1
31
31
1
var count = 0;
2
setTimeout(()=>{
3
count = 1;
4
$('.banner').slick({
5
autoplay:true,
6
autoplaySpeed:2000,
7
centerMode: true,
8
centerPadding: '50px',
9
slidesToShow: 1,
10
speed:2000,
11
pauseOnFocus: false,
12
pauseOnHover: false,
13
pauseOnDotsHover: false,
14
15
},2000) // Initialize the amount of time to delay , Its 2seconds currently.
16
17
if(count == 1){
18
$(function() {
19
$('.banner').slick({
20
autoplay:true,
21
autoplaySpeed:2000,
22
centerMode: true,
23
centerPadding: '50px',
24
slidesToShow: 1,
25
speed:2000,
26
pauseOnFocus: false,
27
pauseOnHover: false,
28
pauseOnDotsHover: false,
29
});
30
}
31