This is my code please check - it's working after some time after reloading the page please help me on this
I am trying to get slick slider when I reload page, but it's only working after some time
$(document).ready(function() {
$('.template-blog .mobile-tag-slider').slick({
dots: false,
infinite: true,
arrows: false,
slidesToShow: 4,
slidesToScroll: 1,
centerMode: true,
centerPadding: '90px',
mobileFirst: true,
responsive: [
{
breakpoint: 600,
settings: "unslick"
},
{
breakpoint: 769,
settings: {
arrows: false,
slidesToShow: 4,
slidesToScroll: 1
}
}
]
});
});
it's showing some second like this after reloading page enter image description here
then it's showing right after some second like this enter image description here
The document ready function executes when the DOM (Document Object Model) is completely loaded in the browser.
Remove this code ** $(document).ready(function() **
$('.template-blog .mobile-tag-slider').slick({
dots: false,
infinite: true,
arrows: false,
slidesToShow: 4,
slidesToScroll: 1,
centerMode: true,
centerPadding: '90px',
mobileFirst: true,
responsive: [
{
breakpoint: 600,
settings: "unslick"
},
{
breakpoint: 769,
settings: {
arrows: false,
slidesToShow: 4,
slidesToScroll: 1
}
}
]
});