flickity
Version:
Touch, responsive, flickable carousels
47 lines (35 loc) • 988 B
HTML
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width" />
<title>tap listener</title>
<style>
.button1 {
width: 200px;
height: 100px;
background: red;
border: 20px solid blue;
margin: 20px;
margin-top: 200px;
}
p { margin: 5px 0;}
</style>
</head>
<body>
<h1>tap listener</h1>
<div class="button1">Button 1</div>
<script src="../bower_components/ev-emitter/ev-emitter.js"></script>
<script src="../bower_components/fizzy-ui-utils/utils.js"></script>
<script src="../bower_components/unipointer/unipointer.js"></script>
<script src="../bower_components/tap-listener/tap-listener.js"></script>
<script>
var tapListener = window.tapListener = new TapListener( document.querySelector('.button1') );
tapListener.on( 'tap', function() {
var p = document.createElement('p');
fizzyUIUtils.setText( p, 'TAP' );
document.body.appendChild( p );
});
</script>
</body>
</html>