'How to add media query in javascript code for drag slide carousel
I have a drag to slide card carousel, now 2.8 cards showing in the main display in desktop, I need 1.2 cards display in mobile view, please add 550 media query in my script code to display 1.2 cards, thanks in advance
<script>
window.sr = ScrollReveal();
var swiper = new Swiper('.swiper-container', {
speed: 300,
parallax: true,
preventClicks: true,
spaceBetween: 6,
slidesPerView: 2.8,
});
$(function() {
FastClick.attach(document.body);
});
</script>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
