jQuery(function ($) { var $maxSlider = $('.maxslider'); $maxSlider.each(function () { var $this = $(this); var navigation = $this.data('navigation'); $this.slick({ dots: navigation === 'dots', arrows: navigation === 'arrows', autoplay: $this.data('autoslide'), autoplaySpeed: $this.data('slide-speed'), fade: $this.data('effect') === 'fade', speed: 600, prevArrow: '', nextArrow: '', responsive: [ { breakpoint: 767, settings: { arrows: false, dots: !!navigation } } ] }); }) });