Showing
6 changed files
with
11 additions
and
18 deletions
@@ -4,8 +4,7 @@ | @@ -4,8 +4,7 @@ | ||
4 | * @date: 2015/10/14 | 4 | * @date: 2015/10/14 |
5 | */ | 5 | */ |
6 | 6 | ||
7 | -var $ = require('jquery'), | ||
8 | - Hammer = require('yoho.hammer'); | 7 | +var $ = require('jquery'); |
9 | 8 | ||
10 | var $nav = $('.category-nav'), | 9 | var $nav = $('.category-nav'), |
11 | $categoryContainer = $('.category-container'), | 10 | $categoryContainer = $('.category-container'), |
@@ -39,8 +38,7 @@ $('.category-container').bind('contextmenu', function(e) { | @@ -39,8 +38,7 @@ $('.category-container').bind('contextmenu', function(e) { | ||
39 | return false; | 38 | return false; |
40 | }); | 39 | }); |
41 | 40 | ||
42 | -navHammer = new Hammer($nav[0]); | ||
43 | -navHammer.on('tap pressup', function(e) { | 41 | +$nav.on('touchend touchcancel', function(e) { |
44 | var $this = $(e.target).closest('li'), | 42 | var $this = $(e.target).closest('li'), |
45 | index = $this.index(); | 43 | index = $this.index(); |
46 | 44 |
@@ -5,7 +5,6 @@ | @@ -5,7 +5,6 @@ | ||
5 | */ | 5 | */ |
6 | 6 | ||
7 | var $ = require('jquery'), | 7 | var $ = require('jquery'), |
8 | - Hammer = require('yoho.hammer'), | ||
9 | Swiper = require('yoho.iswiper'); | 8 | Swiper = require('yoho.iswiper'); |
10 | 9 | ||
11 | var info = require('./info'), | 10 | var info = require('./info'), |
@@ -59,8 +58,7 @@ info.initInfosEvt($infoList); | @@ -59,8 +58,7 @@ info.initInfosEvt($infoList); | ||
59 | $nav.bind('contextmenu', function(e) { | 58 | $nav.bind('contextmenu', function(e) { |
60 | return false; | 59 | return false; |
61 | }); | 60 | }); |
62 | -navHammer = new Hammer($nav[0]); | ||
63 | -navHammer.on('tap pressup', function(e) { | 61 | +$nav.on('touchend touchcancel', function(e) { |
64 | 62 | ||
65 | var $this = $(e.target).closest('.guang-nav-item'), | 63 | var $this = $(e.target).closest('.guang-nav-item'), |
66 | $content, | 64 | $content, |
@@ -5,7 +5,6 @@ | @@ -5,7 +5,6 @@ | ||
5 | */ | 5 | */ |
6 | 6 | ||
7 | var $ = require('jquery'), | 7 | var $ = require('jquery'), |
8 | - Hammer = require('yoho.hammer'), | ||
9 | lazyLoad = require('yoho.lazyload'), | 8 | lazyLoad = require('yoho.lazyload'), |
10 | Swiper = require('yoho.iswiper'); | 9 | Swiper = require('yoho.iswiper'); |
11 | 10 | ||
@@ -23,8 +22,7 @@ mySwiper = new Swiper('.swiper-container', { | @@ -23,8 +22,7 @@ mySwiper = new Swiper('.swiper-container', { | ||
23 | $('#nav-tab').bind('contextmenu', function(e) { | 22 | $('#nav-tab').bind('contextmenu', function(e) { |
24 | return false; | 23 | return false; |
25 | }); | 24 | }); |
26 | -navHammer = new Hammer(document.getElementById('nav-tab')); | ||
27 | -navHammer.on('tap pressup', function(e) { | 25 | +$('#nav-tab').on('touchend touchcancel', function(e) { |
28 | var $this = $(e.target).closest('li'); | 26 | var $this = $(e.target).closest('li'); |
29 | 27 | ||
30 | if ($this.hasClass('focus')) { | 28 | if ($this.hasClass('focus')) { |
@@ -285,8 +285,8 @@ writeSearch.bindWirteLocal($('#search-form')); | @@ -285,8 +285,8 @@ writeSearch.bindWirteLocal($('#search-form')); | ||
285 | $listNav.bind('contextmenu', function(e) { | 285 | $listNav.bind('contextmenu', function(e) { |
286 | return false; | 286 | return false; |
287 | }); | 287 | }); |
288 | -navHammer = new Hammer($listNav[0]); | ||
289 | -navHammer.on('tap pressup', function(e) { | 288 | + |
289 | +$listNav.on('touchend touchcancel', function(e) { | ||
290 | var $this = $(e.target).closest('li'), | 290 | var $this = $(e.target).closest('li'), |
291 | nav, | 291 | nav, |
292 | navType, | 292 | navType, |
@@ -266,8 +266,8 @@ lazyLoad($('.lazy')); | @@ -266,8 +266,8 @@ lazyLoad($('.lazy')); | ||
266 | $listNav.bind('contextmenu', function(e) { | 266 | $listNav.bind('contextmenu', function(e) { |
267 | return false; | 267 | return false; |
268 | }); | 268 | }); |
269 | -navHammer = new Hammer($listNav[0]); | ||
270 | -navHammer.on('tap pressup', function(e) { | 269 | + |
270 | +$listNav.on('touchend touchcancel', function(e) { | ||
271 | var $this = $(e.target).closest('li'), | 271 | var $this = $(e.target).closest('li'), |
272 | nav, | 272 | nav, |
273 | navType, | 273 | navType, |
@@ -6,7 +6,6 @@ | @@ -6,7 +6,6 @@ | ||
6 | 6 | ||
7 | var $ = require('jquery'), | 7 | var $ = require('jquery'), |
8 | Swiper = require('yoho.iswiper'), | 8 | Swiper = require('yoho.iswiper'), |
9 | - Hammer = require('yoho.hammer'), | ||
10 | lazyLoad = require('yoho.lazyload'); | 9 | lazyLoad = require('yoho.lazyload'); |
11 | 10 | ||
12 | var swiper, | 11 | var swiper, |
@@ -295,8 +294,8 @@ $listNav.bind('contextmenu', function(e) { | @@ -295,8 +294,8 @@ $listNav.bind('contextmenu', function(e) { | ||
295 | //3.筛选无active时点击展开筛选面板 | 294 | //3.筛选无active时点击展开筛选面板 |
296 | //4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态 | 295 | //4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态 |
297 | //5.当前active为筛选并且点击其他项时,隐藏筛选面板 | 296 | //5.当前active为筛选并且点击其他项时,隐藏筛选面板 |
298 | -navHammer = new Hammer($listNav[0]); | ||
299 | -navHammer.on('tap pressup', function(e) { | 297 | +// navHammer = new Hammer($listNav[0]); |
298 | +$listNav.on('touchend touchcancel', function(e) { | ||
300 | var $this = $(e.target).closest('li'), | 299 | var $this = $(e.target).closest('li'), |
301 | nav, | 300 | nav, |
302 | navType, | 301 | navType, |
@@ -373,7 +372,7 @@ navHammer.on('tap pressup', function(e) { | @@ -373,7 +372,7 @@ navHammer.on('tap pressup', function(e) { | ||
373 | search(); | 372 | search(); |
374 | } | 373 | } |
375 | } | 374 | } |
376 | - e.srcEvent.stopPropagation(); | 375 | + e.stopPropagation(); |
377 | }); | 376 | }); |
378 | 377 | ||
379 | $(window).scroll(function() { | 378 | $(window).scroll(function() { |
-
Please register or login to post a comment