Files
2013-09-09 11:40:12 -05:00

36 lines
1.0 KiB
HTML

<html>
<head>
<meta charset="utf-8">
<title>Example</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="css/ionic.css">
<style>
#drag-me {
position: absolute;
width: 100px;
height: 100px;
background-color: red;
}
</style>
</head>
<body>
<div class="content content-padded">
<div id="drag-me">Drag me around!</div>
</div>
<script src="../../js/framework/framework-utils.js"></script>
<script src="../../js/framework/framework-gestures.js"></script>
<script src="../../js/framework/framework-events.js"></script>
<script>
var db = document.getElementById('drag-me');
window.FM.onGesture('drag', function(e) {
console.log('Dragging', e);
var touch = e.gesture.touches[0];
db.style.left = touch.pageX-50;
db.style.top = touch.pageY-50;
}, db);
</script>
</body>
</html>