I need the the animation to change based on the screen size.
$(document).ready(function() {
if ($(window).width() <= 900) {
$(".slider").slick({
centerMode: true,
slidesToShow: 1,
});
} else {
$(".slider").slick({
centerMode: true,
slidesToShow: 3,
});
}
});
The above code only works when I reload the page. I want it to change as the screen size changes without the need of reloading. Can you help me?