热销排行一周热卖js modify @review by 王成龙
Showing
1 changed file
with
9 additions
and
1 deletions
@@ -117,6 +117,10 @@ $('.logo-brand').logoBrand({ | @@ -117,6 +117,10 @@ $('.logo-brand').logoBrand({ | ||
117 | var nowIndex = $(this).index(), | 117 | var nowIndex = $(this).index(), |
118 | sid = $(this).data('sid'); | 118 | sid = $(this).data('sid'); |
119 | 119 | ||
120 | + if ($(this).hasClass('current')) { | ||
121 | + return; | ||
122 | + } | ||
123 | + | ||
120 | //处理current样式 | 124 | //处理current样式 |
121 | $(this).addClass('current').siblings().removeClass('current'); | 125 | $(this).addClass('current').siblings().removeClass('current'); |
122 | $('.floatlayer').find('li').removeClass('current').eq(nowIndex).addClass('current'); | 126 | $('.floatlayer').find('li').removeClass('current').eq(nowIndex).addClass('current'); |
@@ -135,7 +139,11 @@ $('.logo-brand').logoBrand({ | @@ -135,7 +139,11 @@ $('.logo-brand').logoBrand({ | ||
135 | $('.floatlayer').on('click', 'li', function() { | 139 | $('.floatlayer').on('click', 'li', function() { |
136 | var nowIndex = $(this).index(); | 140 | var nowIndex = $(this).index(); |
137 | 141 | ||
138 | - $('.hot-cate').find('li').trigger('click'); | 142 | + if ($(this).hasClass('current')) { |
143 | + return; | ||
144 | + } | ||
145 | + | ||
146 | + $('.hot-cate').find('li').eq(nowIndex).trigger('click'); | ||
139 | 147 | ||
140 | //处理current样式 | 148 | //处理current样式 |
141 | $(this).addClass('current').siblings().removeClass('current'); | 149 | $(this).addClass('current').siblings().removeClass('current'); |
-
Please register or login to post a comment