Home › Forums › Gutenberg › InnerBlocks + Slick slider › Reply To: InnerBlocks + Slick slider
If anyone finds this as I did, I got it working by basically “unslicking” and reslicking my slides:
(function($){
var initializeBlock = function( $block ) {
var sliders = $block.find('.testimonial-quotes');
if (window.acf) {
if (sliders.hasClass('slick-initialized')) {
sliders.slick('unslick');
}
}
sliders.slick({
dots: true,
infinite: true,
speed: 800,
slidesToShow: 1,
slidesToScroll: 1,
draggable: true,
fade: true,
cssEase: 'linear',
arrows: false,
dotsClass: 'ep-block-dots',
autoplay: true,
autoplaySpeed: 5000,
});
}
// Initialize dynamic block preview (editor).
if( window.acf ) {
window.acf.addAction( 'render_block_preview/type=wed-testimonials', initializeBlock );
//window.acf.addAction('remount/type=wed-testimonials', initializetestimonials );
}
})(jQuery);
Hope that helps someone!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.