Showing
1 changed file
with
5 additions
and
3 deletions
@@ -19,8 +19,9 @@ require('./good'); | @@ -19,8 +19,9 @@ require('./good'); | ||
19 | 19 | ||
20 | lazyLoad($('img.lazy')); | 20 | lazyLoad($('img.lazy')); |
21 | 21 | ||
22 | -navHammer = new Hammer(document.getElementsByClassName('cart-nav')[0]); | ||
23 | -navHammer.on('tap', function(e) { | 22 | +if ($('.cart-nav').length > 0) { |
23 | + navHammer = new Hammer(document.getElementsByClassName('cart-nav')[0]); | ||
24 | + navHammer.on('tap', function(e) { | ||
24 | var $this = $(e.target).closest('li'); | 25 | var $this = $(e.target).closest('li'); |
25 | 26 | ||
26 | if ($this.hasClass('active')) { | 27 | if ($this.hasClass('active')) { |
@@ -41,7 +42,8 @@ navHammer.on('tap', function(e) { | @@ -41,7 +42,8 @@ navHammer.on('tap', function(e) { | ||
41 | 42 | ||
42 | //trigger lazyload | 43 | //trigger lazyload |
43 | $(window).trigger('scroll'); | 44 | $(window).trigger('scroll'); |
44 | -}); | 45 | + }); |
46 | +} | ||
45 | 47 | ||
46 | $('.btn-balance').on('touchend', function() { | 48 | $('.btn-balance').on('touchend', function() { |
47 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; | 49 | window.location.href = '/cart/index/orderEnsure?cartType=' + cartType; |
-
Please register or login to post a comment