brand index hover.Review by:@xuqi
Showing
2 changed files
with
13 additions
and
2 deletions
@@ -132,10 +132,17 @@ $brandMore.click(function() { | @@ -132,10 +132,17 @@ $brandMore.click(function() { | ||
132 | }); | 132 | }); |
133 | 133 | ||
134 | //【品牌】索引 | 134 | //【品牌】索引 |
135 | -$('.brands-index').on('click', 'span', function() { | 135 | +$('.brands-index').on('mouseenter', 'span', function() { |
136 | var $this = $(this), | 136 | var $this = $(this), |
137 | index = $this.data('index'); | 137 | index = $this.data('index'); |
138 | 138 | ||
139 | + if ($this.hasClass('hover')) { | ||
140 | + return; | ||
141 | + } | ||
142 | + | ||
143 | + $this.siblings('span.hover').removeClass('hover'); | ||
144 | + $this.addClass('hover'); | ||
145 | + | ||
139 | if ($this.index() === 0) { | 146 | if ($this.index() === 0) { |
140 | 147 | ||
141 | //全部 | 148 | //全部 |
@@ -170,15 +170,19 @@ | @@ -170,15 +170,19 @@ | ||
170 | float: left; | 170 | float: left; |
171 | line-height: 30px; | 171 | line-height: 30px; |
172 | margin-right: 5px; | 172 | margin-right: 5px; |
173 | + cursor: pointer; | ||
173 | 174 | ||
174 | span { | 175 | span { |
175 | margin: 0 3px; | 176 | margin: 0 3px; |
176 | - cursor: pointer; | ||
177 | -moz-user-select: none; | 177 | -moz-user-select: none; |
178 | 178 | ||
179 | &:first-child { | 179 | &:first-child { |
180 | margin-left: 10px; | 180 | margin-left: 10px; |
181 | } | 181 | } |
182 | + | ||
183 | + &.hover { | ||
184 | + color: #f00; | ||
185 | + } | ||
182 | } | 186 | } |
183 | } | 187 | } |
184 | 188 |
-
Please register or login to post a comment