hammer is not a function


Topic: hammer is not a function

Pedro Henrique Lira pro asked 6 years ago

swipe: function (id) {
    $(id).hammer().on('swipeleft', function () {
        $(this).carousel('next');
    });
    $(id).hammer().on('swiperight', function () {
        $(this).carousel('prev');
    });
}

example


Bartłomiej Malanowski staff pro premium answered 6 years ago

As of 4.5.7, we dropped Hammer.js as a dependency. You can read more on the changelog


Pedro Henrique Lira pro commented 6 years ago

Okay, but how do I now to use swipe event?


Bartłomiej Malanowski staff pro premium commented 6 years ago

As I can see, you're trying to add swipe to the carousel. As of Bootstrap 4.2, Carousel already supports touch events by default. You can read more here: https://mdbootstrap.com/docs/jquery/javascript/carousel/#options


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.7.7
  • Device: iMac
  • Browser: Chrome
  • OS: OS X
  • Provided sample code: No
  • Provided link: Yes
Tags