JSFiddle - React, Tailwind, and code Playground
by bizamajig
HTML
<script src="http://hammerjs.github.io/dist/hammer.min.js"></script>
<div id="blue"></div>
CSS
#blue{
position:absolute;
top:100px;
left:100px;
width:100px;
height:100px;
background-color:blue;
cursor:pointer;
right:
}
JavaScript
var $element = $( '#blue' );
Hammer( $element ).on( 'swipeleft', function() {
//$element.animate({left: "-=100"}, 500) ;
});
Hammer( $element ).on( 'swiperight', function() {
//$element.animate({left: "+=100"}, 500) ;
});