How can I call this function again once a user resizes their browser?
<script type="text/javascript">
var x = window.matchMedia("(min-width: 1150px)")
if (x.matches) {
$(document).on('ready', function() {
$(".regular").slick({
dots: true,
infinite: true,
slidesToShow: 4,
slidesToScroll: 1,
autoplay: true,
utoplaySpeed: 5000
});
});
} else {
$(document).on('ready', function() {
$(".regular").slick({
dots: true,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
utoplaySpeed: 5000,
centerMode: true
});
});
}
</script>