-
Notifications
You must be signed in to change notification settings - Fork 0
/
rotateDemo.html
32 lines (28 loc) · 913 Bytes
/
rotateDemo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head></head>
<meta name="viewport" content="width=device-width, initial-scale=0.8, maximum-scale=1, user-scalable=no" />
<script src="MMGestureRecognizer.js"></script>
<script>
//display
function display(ob){
var arr=[];
for(var i in ob){
arr.push((i +" - "+ob[i]).slice(0,30));
}
__log(arr.join('<br>'));
}
function __log(a){
document.body.innerHTML="---------------------------------------<br>"//+ document.body.innerHTML;
document.body.innerHTML="<h1>"+a +"</h1>"//+ document.body.innerHTML;
}
window.onload=function(){
var recognizer = new MMGestureRecognizer( document.body);
var angle=0;
recognizer.on('rotate',function(e){
angle += e.angleChanged;
document.querySelector('div').style.transform='rotate('+angle+'deg)';
});
};
</script>
<body><div style="background-color:lightBlue;width:30px;height:30px;"></div></body>
</html>