Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (51 sloc) 1.4 KB
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Zepto touch functional test</title>
<meta name="viewport" content="maximum-scale=1,initial-scale=1,user-scalable=0">
<script src="../src/polyfill.js"></script>
<script src="../src/zepto.js"></script>
<script src="../src/event.js"></script>
<script src="../src/touch.js"></script>
</head>
<body>
<h1>Zepto touch functional test</h1>
<div id="touch_test" style="width: 200px; height: 200px; background: #ddd; -webkit-user-select: none">
touch events test
</div>
<div id="browser"> </div>
<script>
$('#browser').text(navigator.userAgent)
$('body').bind('touchmove', function(e){ e.preventDefault() })
$('#touch_test')
.tap(function(){
$(this).append(' | tap!')
})
.doubleTap(function(){
$(this).append(' | double tap!')
})
.swipe(function(){
$(this).append(' | swipe!')
})
.swipeLeft(function(){
$(this).append(' | swipe left!')
})
.swipeRight(function(){
$(this).append(' | swipe right!')
})
.swipeUp(function(){
$(this).append(' | swipe up!')
})
.swipeDown(function(){
$(this).append(' | swipe down!')
})
.longTap(function(){
$(this).append(' | long tap!')
})
.singleTap(function(){
$(this).append(' | single tap!')
})
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.