javascript - Hammer JS not working with backbone -


i'm trying hammer js events working backbone can't respond events. i've tried following already..

http://cijug.net/tech/2013/01/16/backbone-hammer/

https://gist.github.com/kjantzer/4279025

i've put below piece of code in view

initialize: function(){     this.events = _.extend({}, this.defaultevents, this.events||{});       } 

js fiddle : http://jsfiddle.net/xcyhd/

code

<div id="swiping"></div>  js  appview = backbone.view.extend({    el: '#swiping',              events: {     'swipe': 'swipeme'   },    render: function(){                  this.$el.html('<h2>swipe me</h2>');   },    swipeme: function(e){                     alert('swiped ' + e.direction);   }  });  var view = new appview(); view.render();  

libraries included - hammer.js , jquery.specialevent.hammer.js , etc..

anyway working ?

you don't need special events plugin, i'd go jquery plugin , run hammer() function in render.

  render: function(){                  this.$el.html('<h2>swipe me</h2>');     this.$el.hammer();   }, 

here's updated fiddle: http://jsfiddle.net/xcyhd/20/


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -