JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/hammer.js/1.0.3/hammer.min.js"></script>
<script src="https://github.com/dantipa/hammer.js/raw/master/jquery.specialevent.hammer.js"></script>
<div id="swiping"></div>
CSS
#swiping {
height: 100px;
width: 300px;
text-align: center;
background: blue;
color: white;
}
JavaScript
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();