Showing
6 changed files
with
34 additions
and
4 deletions
@@ -33,4 +33,12 @@ navHammer.on('tap', function(e) { | @@ -33,4 +33,12 @@ navHammer.on('tap', function(e) { | ||
33 | $contents.toggleClass('hide'); | 33 | $contents.toggleClass('hide'); |
34 | 34 | ||
35 | $(document).trigger('scroll'); //Trigger lazyLoad | 35 | $(document).trigger('scroll'); //Trigger lazyLoad |
36 | +}); | ||
37 | +$('#nav-tab').on('touchstart', function(e) { | ||
38 | + var target = e.target || e.srcElement; | ||
39 | + | ||
40 | + target.className = 'bytouch ' + target.className; | ||
41 | + console.log(target); | ||
42 | +}).on('touchend touchcancel', function() { | ||
43 | + $navs.removeClass('bytouch'); | ||
36 | }); | 44 | }); |
@@ -373,3 +373,11 @@ $(window).scroll(function() { | @@ -373,3 +373,11 @@ $(window).scroll(function() { | ||
373 | 373 | ||
374 | //初始请求最新第一页数据 | 374 | //初始请求最新第一页数据 |
375 | search(); | 375 | search(); |
376 | + | ||
377 | +$listNav.on('touchstart', function(e) { | ||
378 | + var target = e.target || e.srcElement; | ||
379 | + | ||
380 | + target.parentNode.parentNode.className = 'bytouch ' + target.parentNode.parentNode.className; | ||
381 | +}).on('touchend touchcancel', function() { | ||
382 | + $listNav.find('li').removeClass('bytouch'); | ||
383 | +}); |
@@ -385,3 +385,11 @@ $(window).scroll(function() { | @@ -385,3 +385,11 @@ $(window).scroll(function() { | ||
385 | 385 | ||
386 | //初始请求最新第一页数据 | 386 | //初始请求最新第一页数据 |
387 | search(); | 387 | search(); |
388 | + | ||
389 | +$listNav.on('touchstart', function(e) { | ||
390 | + var target = e.target || e.srcElement; | ||
391 | + | ||
392 | + target.parentNode.className = 'bytouch ' + target.parentNode.className; | ||
393 | +}).on('touchend touchcancel', function() { | ||
394 | + $listNav.find('li').removeClass('bytouch'); | ||
395 | +}); |
@@ -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