Authored by uedxwg

hotrank添加导航高亮效果

... ... @@ -82,6 +82,7 @@ $('#hotRank').on('touchend touchcancel', function(e) {
var target = ev.target || ev.srcElement;
if (target.nodeName.toLowerCase() === 'span') {
$('.s-goods-nav .nav-item').removeClass('active');
target.parentNode.className = 'active ' + target.parentNode.className;
id = target.getAttribute('data-id') ? target.getAttribute('data-id') : '';
sort = target.getAttribute('data-sort') ? target.getAttribute('data-sort') : '';
... ... @@ -98,9 +99,9 @@ $('#hotRank').on('touchstart', function(e) {
var target = ev.target || ev.srcElement;
if (target.nodeName.toLowerCase() === 'span') {
target.parentNode.className = 'active ' + target.parentNode.className;
target.parentNode.className = 'bgActive ' + target.parentNode.className;
}
}).on('touchend touchcancel', function() {
$('.s-goods-nav .nav-item').removeClass('active');
$('.s-goods-nav .nav-item').removeClass('bgActive');
});
... ...
... ... @@ -138,6 +138,9 @@
color: #999;
&.active{
color: #000;
}
&.bgActive{
color: #000;
background-color:#e0e0e0;
}
a {
... ...
... ... @@ -3,7 +3,7 @@
<ul class="swiper-wrapper clearfix">
{{# tabs}}
{{# title}}
<li class="swiper-slide nav-item">
<li class="swiper-slide nav-item {{#if @first}} active{{/if}}">
<span data-sort="{{ params}}" data-id="{{ id}}" >{{ name}}</span>
</li>
{{/ title}}
... ...