Avada Forums Community Forum Image carousel 1 column on mobile Reply To: Image carousel 1 column on mobile

Jeremy
Participant
Post count: 5

Hopefully this helps as it was bugging me a lot also. I have 3 columns on desktop and wanted 1 on mobile.

Add a fusion code block to the page with the carousel and insert the below: Let me know if it works!

<script>
var fusionCarousel = document.querySelector(".fusion-carousel");

function myFunction(x) {
  if (x.matches) { fusionCarousel.dataset.columns = 1;
  } else {
    fusionCarousel.dataset.columns = 3;
  }
}

var x = window.matchMedia("(max-width: 800px)")
myFunction(x)
x.addListener(myFunction)

</script>