Showing
1 changed file
with
4 additions
and
4 deletions
@@ -86,16 +86,16 @@ disableScroll(); | @@ -86,16 +86,16 @@ disableScroll(); | ||
86 | // 移动端touch重写 | 86 | // 移动端touch重写 |
87 | var startX, startY; | 87 | var startX, startY; |
88 | $sideNav.on('touchstart', function(e){ | 88 | $sideNav.on('touchstart', function(e){ |
89 | - startX = e.changedTouches[0].pageX; | ||
90 | - startY = e.changedTouches[0].pageY; | 89 | + startX = e.originalEvent.touches[0].pageX; |
90 | + startY = e.originalEvent.touches[0].pageY; | ||
91 | }); | 91 | }); |
92 | 92 | ||
93 | // 仿innerScroll方法 | 93 | // 仿innerScroll方法 |
94 | $sideNav.on('touchmove', function(e){ | 94 | $sideNav.on('touchmove', function(e){ |
95 | e.stopPropagation(); | 95 | e.stopPropagation(); |
96 | 96 | ||
97 | - var deltaX = e.changedTouches[0].pageX - startX; | ||
98 | - var deltaY = e.changedTouches[0].pageY - startY; | 97 | + var deltaX = e.originalEvent.touches[0].pageX - startX; |
98 | + var deltaY = e.originalEvent.touches[0].pageY - startY; | ||
99 | 99 | ||
100 | // 只能纵向滚 | 100 | // 只能纵向滚 |
101 | if(Math.abs(deltaY) < Math.abs(deltaX)){ | 101 | if(Math.abs(deltaY) < Math.abs(deltaX)){ |
-
Please register or login to post a comment