Search code examples
javascripthtmlmaterialize

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?


Solution

  • in Materialize.js add/edit:

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

    You can set the allowCarouselDrag variable per application.