Showing
1 changed file
with
12 additions
and
10 deletions
@@ -21,7 +21,8 @@ var brandsData, | @@ -21,7 +21,8 @@ var brandsData, | ||
21 | searchBtnHammer, | 21 | searchBtnHammer, |
22 | clearTextHammer, | 22 | clearTextHammer, |
23 | removeHistory, | 23 | removeHistory, |
24 | - searchList; | 24 | + searchList, |
25 | + yohoHistory; | ||
25 | 26 | ||
26 | swiper = new Swiper('.swiper-container', { | 27 | swiper = new Swiper('.swiper-container', { |
27 | lazyLoading: true, | 28 | lazyLoading: true, |
@@ -134,12 +135,14 @@ function searchResult() { | @@ -134,12 +135,14 @@ function searchResult() { | ||
134 | } | 135 | } |
135 | console.log($('.search-result .brand-list p').length); | 136 | console.log($('.search-result .brand-list p').length); |
136 | $('.search-result .brand-list p').each(function (index) { | 137 | $('.search-result .brand-list p').each(function (index) { |
138 | + | ||
137 | // $('.search-result .brand-list').eq(index).find('p span').click(function () { | 139 | // $('.search-result .brand-list').eq(index).find('p span').click(function () { |
138 | // console.log(index); | 140 | // console.log(index); |
139 | // }) | 141 | // }) |
140 | 142 | ||
141 | searchList = new Hammer($('.search-result .brand-list p').eq(index)[0]); | 143 | searchList = new Hammer($('.search-result .brand-list p').eq(index)[0]); |
142 | - searchList.on('tap',function(){ | 144 | + searchList.on('tap', function() { |
145 | + | ||
143 | // var $el = $(e.target); | 146 | // var $el = $(e.target); |
144 | // console.log($el.closest('sapn')).html(); | 147 | // console.log($el.closest('sapn')).html(); |
145 | console.log($('.search-result .brand-list p').eq(index).find('span').html()); | 148 | console.log($('.search-result .brand-list p').eq(index).find('span').html()); |
@@ -180,19 +183,18 @@ if ($('.brand-search-page').length) { | @@ -180,19 +183,18 @@ if ($('.brand-search-page').length) { | ||
180 | return false; | 183 | return false; |
181 | }); | 184 | }); |
182 | if (localStorage) { | 185 | if (localStorage) { |
183 | - var yohoHistory = localStorage.getItem("yohoHistory"); | 186 | + yohoHistory = localStorage.getItem('yohoHistory'); |
184 | 187 | ||
185 | - if (yohoHistory) { | ||
186 | - for (var i = 1; i < yohoHistory.split(" ").length - 1; i++) { | ||
187 | - $("<a href='#'>" + yohoHistory.split(" ")[i] + "</a>").appendTo(".historyList"); | 188 | + // if (yohoHistory) { |
189 | + // for (var i = 1; i < yohoHistory.split(" ").length - 1; i++) { | ||
190 | + // $("<a href='#'>" + yohoHistory.split(" ")[i] + "</a>").appendTo(".historyList"); | ||
191 | + // } | ||
192 | + // } | ||
188 | } | 193 | } |
189 | - } | ||
190 | - | ||
191 | - }; | ||
192 | 194 | ||
193 | removeHistory = new Hammer($('.removeHistory')[0]); | 195 | removeHistory = new Hammer($('.removeHistory')[0]); |
194 | removeHistory.on('tap', function(e) { | 196 | removeHistory.on('tap', function(e) { |
195 | - $(".historyList").html(" "); | 197 | + $('.historyList').html(' '); |
196 | localStorage.clear(); | 198 | localStorage.clear(); |
197 | }); | 199 | }); |
198 | 200 |
-
Please register or login to post a comment