$(document).ready(function(){
$('#eventCategorySelect').change(function () {
$('#events').html('');
$.ajax({
type: 'GET',
url: '/wp-admin/admin-ajax.php',
data: {
'event-category': $(this).val(),
action: 'getCategoryEvents'
}
}).done(function(res){
$('#events').slick('unslick');
$('#events').html(res);
$('#events').slick(getSliderSettings());
});
});
$('#events').slick(getSliderSettings());
function getSliderSettings(){
return {
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
arrows: true,
prevArrow:"",
nextArrow:"",
responsive: [
{
breakpoint: 1300,
settings: {
slidesToShow: 2,
}
},
{
breakpoint: 500,
settings: {
slidesToShow: 1,
}
}
]
}
}
});