Authored by ccbikai

品牌一览背景色

@@ -43,7 +43,7 @@ $fixTitleBar.css({ @@ -43,7 +43,7 @@ $fixTitleBar.css({
43 top: brandSwipe 43 top: brandSwipe
44 }).hide(); 44 }).hide();
45 minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() + $('.banner-top').outerHeight(); 45 minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() + $('.banner-top').outerHeight();
46 -$('.brand-list').last().append($fixTitleBar); 46 +$brandList.last().append($fixTitleBar);
47 47
48 $(window).scroll(function() { 48 $(window).scroll(function() {
49 var scrTop = $(window).scrollTop(); 49 var scrTop = $(window).scrollTop();
@@ -64,6 +64,19 @@ $(window).scroll(function() { @@ -64,6 +64,19 @@ $(window).scroll(function() {
64 }); 64 });
65 }); 65 });
66 66
  67 +
  68 +function changeBackground() {
  69 + var $brandList = $('.brand-list').find('p');
  70 +
  71 + $brandList.on('touchstart', function() {
  72 + $brandList.css('background', '#fff');
  73 + $(this).css('background', '#eee');
  74 + }).on('touchend touchcancel', function() {
  75 + $(this).css('background', '#fff');
  76 + });
  77 +}
  78 +changeBackground();
  79 +
67 function searchResult() { 80 function searchResult() {
68 var keyword = ($keyword.val() + '').toLowerCase(); 81 var keyword = ($keyword.val() + '').toLowerCase();
69 var result = {}, 82 var result = {},
@@ -113,6 +126,7 @@ function searchResult() { @@ -113,6 +126,7 @@ function searchResult() {
113 126
114 // 插入 dom,绑定事件 127 // 插入 dom,绑定事件
115 $('.search-result').html(html); 128 $('.search-result').html(html);
  129 + changeBackground();
116 } 130 }
117 131
118 if ($('.brand-search-page').length) { 132 if ($('.brand-search-page').length) {