Authored by 梁志锋

侧边栏滚动效果修改

@@ -60,7 +60,7 @@ function stopPropagation(e){ @@ -60,7 +60,7 @@ function stopPropagation(e){
60 // return false; 60 // return false;
61 }**/ 61 }**/
62 62
63 -var disableScroll = function(){ 63 +/**var disableScroll = function(){
64 $(document).on('mousewheel', preventDefault); 64 $(document).on('mousewheel', preventDefault);
65 $(document).on('touchmove', preventDefault); 65 $(document).on('touchmove', preventDefault);
66 }; 66 };
@@ -70,13 +70,6 @@ var enableScroll = function(){ @@ -70,13 +70,6 @@ var enableScroll = function(){
70 $(document).off('touchmove', preventDefault); 70 $(document).off('touchmove', preventDefault);
71 }; 71 };
72 72
73 -// bind  
74 -/**$('#closePopup').on('click', function(e){  
75 - $('#popupLayer').hide();  
76 - $('#bgMask').hide();  
77 - enableScroll();  
78 -});**/  
79 -  
80 // 内部可滚 73 // 内部可滚
81 $sideNav.on('touchmove mousewheel', stopPropagation); 74 $sideNav.on('touchmove mousewheel', stopPropagation);
82 75
@@ -89,7 +82,7 @@ var startX, startY; @@ -89,7 +82,7 @@ var startX, startY;
89 $sideNav.on('touchstart', function(e){ 82 $sideNav.on('touchstart', function(e){
90 startX = e.originalEvent.touches[0].pageX; 83 startX = e.originalEvent.touches[0].pageX;
91 startY = e.originalEvent.touches[0].pageY; 84 startY = e.originalEvent.touches[0].pageY;
92 -}); 85 +});**/
93 86
94 // 仿innerScroll方法 87 // 仿innerScroll方法
95 /**$sideNav.on('touchmove', function(e){ 88 /**$sideNav.on('touchmove', function(e){
@@ -132,10 +125,10 @@ $('.nav-btn').on('touchstart', function(event) { @@ -132,10 +125,10 @@ $('.nav-btn').on('touchstart', function(event) {
132 openSideNav = true; 125 openSideNav = true;
133 126
134 //设置boy高宽,页面不能上下滑动 127 //设置boy高宽,页面不能上下滑动
135 - /**$('body').css({ 128 + $('body').css({
136 height: $(window).height(), 129 height: $(window).height(),
137 overflow: 'hidden' 130 overflow: 'hidden'
138 - });**/ 131 + });
139 132
140 setTimeout(function() { 133 setTimeout(function() {
141 $sideNav.css('pointer-events', 'auto'); 134 $sideNav.css('pointer-events', 'auto');
@@ -151,11 +144,11 @@ function hideSideBar() { @@ -151,11 +144,11 @@ function hideSideBar() {
151 $('.overlay').hide(); 144 $('.overlay').hide();
152 $('.sub-nav').removeClass('show'); 145 $('.sub-nav').removeClass('show');
153 $sideNav.removeClass('on'); 146 $sideNav.removeClass('on');
154 - /**$('body').css({ 147 + $('body').css({
155 height: 'auto', 148 height: 'auto',
156 overflow: 'auto' 149 overflow: 'auto'
157 - });**/  
158 - enableScroll(); 150 + });
  151 + //enableScroll();
159 } 152 }
160 } 153 }
161 154