Skip to content

Commit e33722b

Browse files
committed
调整demo
1 parent 6c20bfc commit e33722b

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

touch.html

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,28 @@
122122
});
123123

124124
bodyTouch.on('swipeStart','.checkA',function(e){
125-
$('.console1').append('swipeStart'+I()+'<br/>');
125+
$('.console1').append('swipeStart<br/>');
126+
$(this).css({
127+
'position':'relative',
128+
'background':'#ddd'
129+
});
126130
}).on('swipe','.checkA',function(e){
127-
$('.console1').append('swipe'+I()+'<br/>');
128-
console.log(this,e);
131+
$('.console1').append('swipe-'+e.pageX +'<br/>');
132+
// console.log(this,e);
133+
$(this).css({
134+
'top':e.moveY,
135+
'left':e.moveX
136+
});
129137
}).on('swipeEnd','.checkA',function(e){
130-
$('.console1').append('swipeEnd'+I()+'<br/>');
138+
$('.console1').append('swipeEnd<br/>');
131139
console.log(this,e);
140+
$(this).animate({
141+
'position':'static',
142+
'top':0,
143+
'left':0,
144+
'background':'#fff'
145+
},100);
146+
$(this).css('background','#fff');
132147
});
133148

134149
bodyTouch.on('singleTap','.checkB',function(e){
@@ -153,4 +168,5 @@
153168
$('.console').html('logger<br/>');
154169
});
155170
</script>
156-
</body>
171+
</body>
172+
</html>

0 commit comments

Comments
 (0)