Enabling Vertical swipes in hammer.js

750 views
Skip to first unread message

abhishek singh

unread,
Nov 2, 2014, 2:06:07 AM11/2/14
to meteo...@googlegroups.com
Hi guys, I'm trying to detect swipe up and swipe down in hammer.js but I'm unable to do so. I tried entering the line of code from the hammer.js documentation that sets DIRECTION_VERTICAL on swipe but it doesn't seem to be working. The other gestures are working however. Any ideas?I have installed the noorserstorm:hammer package. Thanks!

Charlie Magee

unread,
Dec 10, 2014, 7:52:47 PM12/10/14
to meteo...@googlegroups.com
Hi Abhishek,

It appears that the author of noorserstorm:hammer has stopped maintaining that package. I'm also trying to figure out what to do. In a world that has gone mobile, you'd think that gestures would be built into a system like Meteor. I'm debating using hammer.js and figuring it all out myself, but too busy at the moment.

Please let the group know if you come up with a solution.

Charlie Magee

Charlie Magee

unread,
Dec 10, 2014, 8:54:31 PM12/10/14
to meteo...@googlegroups.com
To answer your question, though, that package still works . . . here's something I wrote. It runs fine.

Make sure you're correctly calling the div that you're swiping. In my case it's a div with class="headertitle". I'm using the swipe to switch pages with iron router . . . put whatever you like there, it should run fine.


Template.goalsList.events({

  'swipedown .headertitle': function(e) {

    Router.go('logOut');

  }

});


Charlie Magee


Charlie Magee

unread,
Dec 10, 2014, 9:03:12 PM12/10/14
to meteo...@googlegroups.com
Another gotcha to watch for . . . many libraries use camelCode. Make sure you're using swipedown instead of swipeDown in hammer.

Dan Dascalescu

unread,
Dec 11, 2014, 5:21:27 AM12/11/14
to meteo...@googlegroups.com
On Wednesday, December 10, 2014 4:52:47 PM UTC-8, Charlie Magee wrote:
It appears that the author of noorserstorm:hammer has stopped maintaining that package.

Why would you even consider that package when there's the official hammer:hammer

Charlie Magee

unread,
Dec 11, 2014, 12:13:58 PM12/11/14
to meteo...@googlegroups.com
For the laziness of doing meteor add

Sander Garretsen

unread,
Dec 11, 2014, 5:24:47 PM12/11/14
to meteo...@googlegroups.com
like

meteor add hammer:hammer ?

Op donderdag 11 december 2014 18:13:58 UTC+1 schreef Charlie Magee:

Charlie Magee

unread,
Dec 11, 2014, 6:02:00 PM12/11/14
to meteo...@googlegroups.com
Well, I'll be damned. Didn't know there was a hammer:hammer. The noorserstorm was the only one when I put my app together.

Thanks for the heads up.

Charlie
Reply all
Reply to author
Forward
0 new messages