Authored by ccbikai

个人中心点击背景变化

@@ -4,7 +4,8 @@ @@ -4,7 +4,8 @@
4 * @date: 2015/11/12 4 * @date: 2015/11/12
5 */ 5 */
6 var $ = require('jquery'); 6 var $ = require('jquery');
7 -var $userAvatar = $('.user-avatar'); 7 +var $userAvatar = $('.user-avatar'),
  8 + $listItem = $('.list-item');
8 var myImage = new Image(); 9 var myImage = new Image();
9 10
10 require('../product/recommend-for-you.js'); 11 require('../product/recommend-for-you.js');
@@ -12,3 +13,10 @@ myImage.src = $userAvatar.attr('src'); @@ -12,3 +13,10 @@ myImage.src = $userAvatar.attr('src');
12 myImage.onerror = function() { 13 myImage.onerror = function() {
13 $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'); 14 $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png');
14 }; 15 };
  16 +
  17 +$('.yoho-page').on('touchstart', '.list-item, .type-item', function() {
  18 + $listItem.removeClass('highlight');
  19 + $(this).addClass('highlight');
  20 +}).on('touchend touchcancel', '.list-item, .type-item', function() {
  21 + $(this).removeClass('highlight');
  22 +});
@@ -138,6 +138,10 @@ @@ -138,6 +138,10 @@
138 font-size: pxToRem(28px); 138 font-size: pxToRem(28px);
139 line-height: 1.5; 139 line-height: 1.5;
140 width: pxToRem(193px); 140 width: pxToRem(193px);
  141 +
  142 + &.highlight {
  143 + background: #eee;
  144 + }
141 } 145 }
142 146
143 .iconfont { 147 .iconfont {
@@ -158,6 +162,11 @@ @@ -158,6 +162,11 @@
158 padding: 0 pxToRem(30px); 162 padding: 0 pxToRem(30px);
159 font-size: pxToRem(32px); 163 font-size: pxToRem(32px);
160 line-height: pxToRem(88px); 164 line-height: pxToRem(88px);
  165 +
  166 + &.highlight {
  167 + background: #eee;
  168 + }
  169 +
161 &:after { 170 &:after {
162 content: ''; 171 content: '';
163 position: absolute; 172 position: absolute;