Merge remote-tracking branch 'origin/hotfix/xieweiguang'
Showing
12 changed files
with
103 additions
and
15 deletions
@@ -32,9 +32,15 @@ var navHammer; | @@ -32,9 +32,15 @@ var navHammer; | ||
32 | $('#search-input').focus(function() { | 32 | $('#search-input').focus(function() { |
33 | $(this).blur(); | 33 | $(this).blur(); |
34 | }); | 34 | }); |
35 | +$nav.bind('contextmenu', function(e) { | ||
36 | + return false; | ||
37 | +}); | ||
38 | +$('.category-container').bind('contextmenu', function(e) { | ||
39 | + return false; | ||
40 | +}); | ||
35 | 41 | ||
36 | navHammer = new Hammer($nav[0]); | 42 | navHammer = new Hammer($nav[0]); |
37 | -navHammer.on('tap', function(e) { | 43 | +navHammer.on('tap pressup', function(e) { |
38 | var $this = $(e.target).closest('li'), | 44 | var $this = $(e.target).closest('li'), |
39 | index = $this.index(); | 45 | index = $this.index(); |
40 | 46 | ||
@@ -71,7 +77,7 @@ $categoryContainer.on('touchend', function(e) { | @@ -71,7 +77,7 @@ $categoryContainer.on('touchend', function(e) { | ||
71 | } | 77 | } |
72 | }); | 78 | }); |
73 | 79 | ||
74 | -$categoryContainer.find('.primary-level').on('touchstart', 'li', function() { | 80 | +$categoryContainer.find('.primary-level').on('touchstart touchend touchcancel', 'li', function() { |
75 | $primaryItem.removeClass('highlight'); | 81 | $primaryItem.removeClass('highlight'); |
76 | $(this).addClass('highlight'); | 82 | $(this).addClass('highlight'); |
77 | }).on('touchend touchcancel', 'li', function() { | 83 | }).on('touchend touchcancel', 'li', function() { |
@@ -84,3 +90,11 @@ $categoryContainer.find('.sub-level').on('touchstart', 'li', function() { | @@ -84,3 +90,11 @@ $categoryContainer.find('.sub-level').on('touchstart', 'li', function() { | ||
84 | }).on('touchend touchcancel', 'li', function() { | 90 | }).on('touchend touchcancel', 'li', function() { |
85 | $(this).removeClass('highlight'); | 91 | $(this).removeClass('highlight'); |
86 | }); | 92 | }); |
93 | + | ||
94 | +$nav.on('touchstart', function(e) { | ||
95 | + var target = e.target || e.srcElement; | ||
96 | + | ||
97 | + target.parentNode.className = 'bytouch ' + target.parentNode.className; | ||
98 | +}).on('touchend touchcancel', function() { | ||
99 | + $nav.find('li').removeClass('bytouch'); | ||
100 | +}); |
@@ -56,9 +56,12 @@ info.initInfosEvt($infoList); | @@ -56,9 +56,12 @@ info.initInfosEvt($infoList); | ||
56 | }; | 56 | }; |
57 | }); | 57 | }); |
58 | }()); | 58 | }()); |
59 | - | 59 | +$nav.bind('contextmenu', function(e) { |
60 | + return false; | ||
61 | +}); | ||
60 | navHammer = new Hammer($nav[0]); | 62 | navHammer = new Hammer($nav[0]); |
61 | -navHammer.on('tap', function(e) { | 63 | +navHammer.on('tap pressup', function(e) { |
64 | + | ||
62 | var $this = $(e.target).closest('.guang-nav-item'), | 65 | var $this = $(e.target).closest('.guang-nav-item'), |
63 | $content, | 66 | $content, |
64 | index; | 67 | index; |
@@ -112,4 +115,12 @@ $(document).scroll(function() { | @@ -112,4 +115,12 @@ $(document).scroll(function() { | ||
112 | if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $c.height()) { | 115 | if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $c.height()) { |
113 | loadMore($c, state[curType]); | 116 | loadMore($c, state[curType]); |
114 | } | 117 | } |
118 | +}); | ||
119 | + | ||
120 | +$nav.on('touchstart', function(e) { | ||
121 | + var target = e.target || e.srcElement; | ||
122 | + | ||
123 | + target.className = 'bytouch ' + target.className; | ||
124 | +}).on('touchend touchcancel', function() { | ||
125 | + $nav.find('li').removeClass('bytouch'); | ||
115 | }); | 126 | }); |
@@ -20,9 +20,11 @@ mySwiper = new Swiper('.swiper-container', { | @@ -20,9 +20,11 @@ mySwiper = new Swiper('.swiper-container', { | ||
20 | lazyLoading: true, | 20 | lazyLoading: true, |
21 | pagination: '.swiper-pagination' | 21 | pagination: '.swiper-pagination' |
22 | }); | 22 | }); |
23 | - | 23 | +$('#nav-tab').bind('contextmenu', function(e) { |
24 | + return false; | ||
25 | +}); | ||
24 | navHammer = new Hammer(document.getElementById('nav-tab')); | 26 | navHammer = new Hammer(document.getElementById('nav-tab')); |
25 | -navHammer.on('tap', function(e) { | 27 | +navHammer.on('tap pressup', function(e) { |
26 | var $this = $(e.target).closest('li'); | 28 | var $this = $(e.target).closest('li'); |
27 | 29 | ||
28 | if ($this.hasClass('focus')) { | 30 | if ($this.hasClass('focus')) { |
@@ -33,4 +35,11 @@ navHammer.on('tap', function(e) { | @@ -33,4 +35,11 @@ navHammer.on('tap', function(e) { | ||
33 | $contents.toggleClass('hide'); | 35 | $contents.toggleClass('hide'); |
34 | 36 | ||
35 | $(document).trigger('scroll'); //Trigger lazyLoad | 37 | $(document).trigger('scroll'); //Trigger lazyLoad |
38 | +}); | ||
39 | +$('#nav-tab').on('touchstart', function(e) { | ||
40 | + var target = e.target || e.srcElement; | ||
41 | + | ||
42 | + target.className = 'bytouch ' + target.className; | ||
43 | +}).on('touchend touchcancel', function() { | ||
44 | + $navs.removeClass('bytouch'); | ||
36 | }); | 45 | }); |
@@ -281,8 +281,12 @@ writeSearch.bindWirteLocal($('#search-form')); | @@ -281,8 +281,12 @@ writeSearch.bindWirteLocal($('#search-form')); | ||
281 | //3.筛选无active时点击展开筛选面板 | 281 | //3.筛选无active时点击展开筛选面板 |
282 | //4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态 | 282 | //4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态 |
283 | //5.当前active为筛选并且点击其他项时,隐藏筛选面板 | 283 | //5.当前active为筛选并且点击其他项时,隐藏筛选面板 |
284 | + | ||
285 | +$listNav.bind('contextmenu', function(e) { | ||
286 | + return false; | ||
287 | +}); | ||
284 | navHammer = new Hammer($listNav[0]); | 288 | navHammer = new Hammer($listNav[0]); |
285 | -navHammer.on('tap', function(e) { | 289 | +navHammer.on('tap pressup', function(e) { |
286 | var $this = $(e.target).closest('li'), | 290 | var $this = $(e.target).closest('li'), |
287 | nav, | 291 | nav, |
288 | navType, | 292 | navType, |
@@ -443,4 +447,11 @@ if ($brandHeader.length > 0) { | @@ -443,4 +447,11 @@ if ($brandHeader.length > 0) { | ||
443 | } | 447 | } |
444 | 448 | ||
445 | //初始请求最新第一页数据 | 449 | //初始请求最新第一页数据 |
446 | -search(); | ||
450 | +search(); | ||
451 | +$listNav.on('touchstart', function(e) { | ||
452 | + var target = e.target || e.srcElement; | ||
453 | + | ||
454 | + target.parentNode.parentNode.className = 'bytouch ' + target.parentNode.parentNode.className; | ||
455 | +}).on('touchend touchcancel', function() { | ||
456 | + $listNav.find('li').removeClass('bytouch'); | ||
457 | +}); |
@@ -263,8 +263,11 @@ lazyLoad($('.lazy')); | @@ -263,8 +263,11 @@ lazyLoad($('.lazy')); | ||
263 | //3.筛选无active时点击展开筛选面板 | 263 | //3.筛选无active时点击展开筛选面板 |
264 | //4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态 | 264 | //4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态 |
265 | //5.当前active为筛选并且点击其他项时,隐藏筛选面板 | 265 | //5.当前active为筛选并且点击其他项时,隐藏筛选面板 |
266 | +$listNav.bind('contextmenu', function(e) { | ||
267 | + return false; | ||
268 | +}); | ||
266 | navHammer = new Hammer($listNav[0]); | 269 | navHammer = new Hammer($listNav[0]); |
267 | -navHammer.on('tap', function(e) { | 270 | +navHammer.on('tap pressup', function(e) { |
268 | var $this = $(e.target).closest('li'), | 271 | var $this = $(e.target).closest('li'), |
269 | nav, | 272 | nav, |
270 | navType, | 273 | navType, |
@@ -373,3 +376,11 @@ $(window).scroll(function() { | @@ -373,3 +376,11 @@ $(window).scroll(function() { | ||
373 | 376 | ||
374 | //初始请求最新第一页数据 | 377 | //初始请求最新第一页数据 |
375 | search(); | 378 | search(); |
379 | + | ||
380 | +$listNav.on('touchstart', function(e) { | ||
381 | + var target = e.target || e.srcElement; | ||
382 | + | ||
383 | + target.parentNode.parentNode.className = 'bytouch ' + target.parentNode.parentNode.className; | ||
384 | +}).on('touchend touchcancel', function() { | ||
385 | + $listNav.find('li').removeClass('bytouch'); | ||
386 | +}); |
@@ -285,6 +285,10 @@ $.ajax({ | @@ -285,6 +285,10 @@ $.ajax({ | ||
285 | }); | 285 | }); |
286 | lazyLoad($('.lazy')); | 286 | lazyLoad($('.lazy')); |
287 | 287 | ||
288 | +$listNav.bind('contextmenu', function(e) { | ||
289 | + return false; | ||
290 | +}); | ||
291 | + | ||
288 | //导航栏点击逻辑说明: | 292 | //导航栏点击逻辑说明: |
289 | //1.点击非active项时切换active状态 | 293 | //1.点击非active项时切换active状态 |
290 | //2.价格和折扣active状态时继续点击切换排序 | 294 | //2.价格和折扣active状态时继续点击切换排序 |
@@ -292,7 +296,7 @@ lazyLoad($('.lazy')); | @@ -292,7 +296,7 @@ lazyLoad($('.lazy')); | ||
292 | //4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态 | 296 | //4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态 |
293 | //5.当前active为筛选并且点击其他项时,隐藏筛选面板 | 297 | //5.当前active为筛选并且点击其他项时,隐藏筛选面板 |
294 | navHammer = new Hammer($listNav[0]); | 298 | navHammer = new Hammer($listNav[0]); |
295 | -navHammer.on('tap', function(e) { | 299 | +navHammer.on('tap pressup', function(e) { |
296 | var $this = $(e.target).closest('li'), | 300 | var $this = $(e.target).closest('li'), |
297 | nav, | 301 | nav, |
298 | navType, | 302 | navType, |
@@ -385,3 +389,11 @@ $(window).scroll(function() { | @@ -385,3 +389,11 @@ $(window).scroll(function() { | ||
385 | 389 | ||
386 | //初始请求最新第一页数据 | 390 | //初始请求最新第一页数据 |
387 | search(); | 391 | search(); |
392 | + | ||
393 | +$listNav.on('touchstart', function(e) { | ||
394 | + var target = e.target || e.srcElement; | ||
395 | + | ||
396 | + target.parentNode.className = 'bytouch ' + target.parentNode.className; | ||
397 | +}).on('touchend touchcancel', function() { | ||
398 | + $listNav.find('li').removeClass('bytouch'); | ||
399 | +}); |
@@ -59,6 +59,7 @@ | @@ -59,6 +59,7 @@ | ||
59 | height: 80rem / $pxConvertRem; | 59 | height: 80rem / $pxConvertRem; |
60 | } | 60 | } |
61 | 61 | ||
62 | + | ||
62 | .guang-nav-item { | 63 | .guang-nav-item { |
63 | float: left; | 64 | float: left; |
64 | color: #ccc; | 65 | color: #ccc; |
@@ -68,7 +69,11 @@ | @@ -68,7 +69,11 @@ | ||
68 | 69 | ||
69 | &.focus { | 70 | &.focus { |
70 | color: #000; | 71 | color: #000; |
71 | - } | 72 | + } |
73 | + } | ||
74 | + | ||
75 | + .bytouch{ | ||
76 | + background:#eee; | ||
72 | } | 77 | } |
73 | 78 | ||
74 | .info-list-container { | 79 | .info-list-container { |
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | .list-nav { | 34 | .list-nav { |
35 | border-top:2px solid #fff; | 35 | border-top:2px solid #fff; |
36 | border-bottom:1px solid #e6e6e6; | 36 | border-bottom:1px solid #e6e6e6; |
37 | - | 37 | + |
38 | > li { | 38 | > li { |
39 | float: left; | 39 | float: left; |
40 | width: 25%; | 40 | width: 25%; |
@@ -44,7 +44,9 @@ | @@ -44,7 +44,9 @@ | ||
44 | font-size: 14px; | 44 | font-size: 14px; |
45 | color: #999; | 45 | color: #999; |
46 | } | 46 | } |
47 | - | 47 | + .bytouch{ |
48 | + background:#eee; | ||
49 | + } | ||
48 | a { | 50 | a { |
49 | display: inline-block; | 51 | display: inline-block; |
50 | box-sizing: border-box; | 52 | box-sizing: border-box; |
-
Please register or login to post a comment