Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable Touch on Materialize Carousel

It looks like no one has asked this question before since I've pretty much scoured the internet looking for a very simple answer.

How would one go about disabling the ability to swipe left/right on the materialize carousel?

like image 910
Cristian C. Avatar asked Apr 17 '26 23:04

Cristian C.


1 Answers

in Materialize.js add/edit:

var allowCarouselDrag = true;
value: function _handleCarouselDrag(e) {
    if(allowCarouselDrag){
       ....
    }
}

You can set the allowCarouselDrag variable per application.

like image 110
Josh Avatar answered Apr 19 '26 13:04

Josh