Showing
2 changed files
with
11 additions
and
11 deletions
@@ -20,7 +20,6 @@ lazyLoad($('.brand-page img.lazy')); | @@ -20,7 +20,6 @@ lazyLoad($('.brand-page img.lazy')); | ||
20 | 20 | ||
21 | // 品牌类别滚动事件 | 21 | // 品牌类别滚动事件 |
22 | $(window).scroll(function() { | 22 | $(window).scroll(function() { |
23 | - var navLength = $('.category-nav').find('a').length + 1; | ||
24 | 23 | ||
25 | if ($(this).scrollTop() >= categoryTop) { | 24 | if ($(this).scrollTop() >= categoryTop) { |
26 | $gory.addClass('category-fix'); | 25 | $gory.addClass('category-fix'); |
@@ -28,17 +27,18 @@ $(window).scroll(function() { | @@ -28,17 +27,18 @@ $(window).scroll(function() { | ||
28 | $gory.removeClass('category-fix'); | 27 | $gory.removeClass('category-fix'); |
29 | } | 28 | } |
30 | 29 | ||
31 | - $('.brand-key').each(function(i,ele) { | 30 | + $('.brand-key').each(function(i, ele) { |
31 | + var key; | ||
32 | 32 | ||
33 | - if($(ele).parent().attr('style')) { | ||
34 | - return; | ||
35 | - } | 33 | + if ($(ele).parent().attr('style')) { |
34 | + return; | ||
35 | + } | ||
36 | 36 | ||
37 | - if($(ele).offset().top - $(window).scrollTop() < 100) { | ||
38 | - var key = $(ele).html().charAt($(ele).html().length - 1); | ||
39 | - | ||
40 | - $('.category-nav').find('.' + key).css('color', '#379ed6').siblings().css('color', '#222'); | ||
41 | - } | 37 | + if ($(ele).offset().top - $(window).scrollTop() < 100) { |
38 | + key = $(ele).html().charAt($(ele).html().length - 1); | ||
39 | + | ||
40 | + $('.category-nav').find('.' + key).css('color', '#379ed6').siblings().css('color', '#222'); | ||
41 | + } | ||
42 | }); | 42 | }); |
43 | }); | 43 | }); |
44 | 44 |
-
Please register or login to post a comment