This is a similar question to the one here. I am trying to make my slick carousel work after the successful ajax call. Tried every solution there but it still does not seem to work for me.
.reviews-page-carousel slick
$('.reviews-page-carousel').slick({
arrows: false,
slidesToShow: 1,
variableWidth: true,
centerPadding: '10px'
});
ajax call
$.ajax({
type: "GET",
url: review_url + "?page=" + page,
success: function(result) {
$('.reviews-page-carousel').slick('unslick').slick('reinit');
}
})
Tried this as well
$.ajax({
type: "GET",
url: review_url + "?page=" + page,
success: function(result) {
$('.reviews-page-carousel').slick('unslick'); /* ONLY remove the classes and handlers added on initialize */
$('.reviews-page-carousel').slick(getSliderSettings()); /* Initialize the slick again */
}
});
Both gives this error:
Uncaught TypeError: Cannot read property 'unslick' of undefined