|
@@ -14,6 +14,7 @@ var chosePanel = require('./chose-panel'), |
|
@@ -14,6 +14,7 @@ var chosePanel = require('./chose-panel'), |
14
|
|
14
|
|
15
|
var $cartContent = $('.cart-content'),
|
15
|
var $cartContent = $('.cart-content'),
|
16
|
cartType = $('#cartType').val(),
|
16
|
cartType = $('#cartType').val(),
|
|
|
17
|
+ $cartNav = $('.cart-nav'),
|
17
|
hasShowCartPresellTip = false;
|
18
|
hasShowCartPresellTip = false;
|
18
|
|
19
|
|
19
|
var navHammer,
|
20
|
var navHammer,
|
|
@@ -105,7 +106,7 @@ if ('advance' === cartType) { |
|
@@ -105,7 +106,7 @@ if ('advance' === cartType) { |
105
|
$(window).trigger('scroll');
|
106
|
$(window).trigger('scroll');
|
106
|
}
|
107
|
}
|
107
|
|
108
|
|
108
|
-if ($('.cart-nav').length > 0) {
|
109
|
+if ($cartNav.length > 0) {
|
109
|
navHammer = new Hammer(document.getElementsByClassName('cart-nav')[0]);
|
110
|
navHammer = new Hammer(document.getElementsByClassName('cart-nav')[0]);
|
110
|
navHammer.on('tap', function(e) {
|
111
|
navHammer.on('tap', function(e) {
|
111
|
var $this = $(e.target).closest('li');
|
112
|
var $this = $(e.target).closest('li');
|
|
@@ -180,16 +181,11 @@ $('.chose').on('touchend', function() { |
|
@@ -180,16 +181,11 @@ $('.chose').on('touchend', function() { |
180
|
chosePanel.show();
|
181
|
chosePanel.show();
|
181
|
});
|
182
|
});
|
182
|
|
183
|
|
183
|
-function notAllowScroll() {
|
|
|
184
|
- var docH = $(document).height(),
|
|
|
185
|
- winH = $(window).height();
|
|
|
186
|
-
|
|
|
187
|
- if (docH - winH <= 10) {
|
|
|
188
|
- $('body').css('overflow', 'hidden');
|
|
|
189
|
- }
|
|
|
190
|
-}
|
|
|
191
|
-
|
|
|
192
|
-notAllowScroll();
|
184
|
+$cartNav.on('touchstart', 'li', function(e) {
|
|
|
185
|
+ $(this).addClass('bytouch');
|
|
|
186
|
+}).on('touchend touchcancel', function() {
|
|
|
187
|
+ $cartNav.find('li').removeClass('bytouch');
|
|
|
188
|
+});
|
193
|
|
189
|
|
194
|
//提前触发lazyload
|
190
|
//提前触发lazyload
|
195
|
$(window).scrollTop(1).scrollTop(0); |
191
|
$(window).scrollTop(1).scrollTop(0); |