Showing
1 changed file
with
20 additions
and
17 deletions
@@ -37,29 +37,32 @@ if (kidsType) { | @@ -37,29 +37,32 @@ if (kidsType) { | ||
37 | 37 | ||
38 | $curNav = $navList.children('.focus'); | 38 | $curNav = $navList.children('.focus'); |
39 | 39 | ||
40 | -navHammer = new Hammer($navList[0]); | ||
41 | -navHammer.on('tap', function(e) { | ||
42 | - var $this = $(e.target).closest('li'), | ||
43 | - $goods = $('.goods-list'), | ||
44 | - $content; | 40 | +if (kidsType) { |
41 | + navHammer = new Hammer($navList[0]); | ||
42 | + navHammer.on('tap', function(e) { | ||
43 | + var $this = $(e.target).closest('li'), | ||
44 | + $goods = $('.goods-list'), | ||
45 | + $content; | ||
46 | + | ||
47 | + if ($this.hasClass('focus')) { | ||
48 | + return; | ||
49 | + } | ||
45 | 50 | ||
46 | - if ($this.hasClass('focus')) { | ||
47 | - return; | ||
48 | - } | 51 | + index = $this.index(); |
49 | 52 | ||
50 | - index = $this.index(); | 53 | + $this.addClass('focus'); |
54 | + $curNav.removeClass('focus'); | ||
51 | 55 | ||
52 | - $this.addClass('focus'); | ||
53 | - $curNav.removeClass('focus'); | 56 | + $goods.not('.hide').addClass('hide'); |
57 | + $content = $goods.eq(index); | ||
58 | + $content.removeClass('hide'); | ||
54 | 59 | ||
55 | - $goods.not('.hide').addClass('hide'); | ||
56 | - $content = $goods.eq(index); | ||
57 | - $content.removeClass('hide'); | 60 | + $curNav = $this; |
58 | 61 | ||
59 | - $curNav = $this; | 62 | + $(document).trigger('scroll'); //Trigger lazyLoad |
63 | + }); | ||
64 | +} | ||
60 | 65 | ||
61 | - $(document).trigger('scroll'); //Trigger lazyLoad | ||
62 | -}); | ||
63 | 66 | ||
64 | function search() { | 67 | function search() { |
65 | if (loading) { | 68 | if (loading) { |
-
Please register or login to post a comment