Showing
1 changed file
with
13 additions
and
20 deletions
@@ -177,7 +177,7 @@ function newData(callback) { | @@ -177,7 +177,7 @@ function newData(callback) { | ||
177 | 177 | ||
178 | req.url = location.protocol + '//m.yohobuy.com/index/search/search'; | 178 | req.url = location.protocol + '//m.yohobuy.com/index/search/search'; |
179 | req.data = { | 179 | req.data = { |
180 | - type: 'newest', | 180 | + type: 'new', |
181 | order: '1', | 181 | order: '1', |
182 | page: navInfo.new.page, | 182 | page: navInfo.new.page, |
183 | tagNew: '1' | 183 | tagNew: '1' |
@@ -256,13 +256,11 @@ function tabChange(dom, index) { | @@ -256,13 +256,11 @@ function tabChange(dom, index) { | ||
256 | hotData(); | 256 | hotData(); |
257 | viewType = 3; | 257 | viewType = 3; |
258 | } else if (activeTab === 'home-page') { | 258 | } else if (activeTab === 'home-page') { |
259 | - | ||
260 | - myScroll && myScroll.refresh(); | ||
261 | - scH = $('#scroller').outerHeight(); | ||
262 | $nav1.removeClass('fixed-top absolute'); | 259 | $nav1.removeClass('fixed-top absolute'); |
263 | $nav2.removeClass('fixed-top absolute'); | 260 | $nav2.removeClass('fixed-top absolute'); |
264 | } | 261 | } |
265 | - | 262 | + myScroll && myScroll.refresh(); |
263 | + scH = $('#scroller').outerHeight(); | ||
266 | if (!$nav1.hasClass('hide')) { | 264 | if (!$nav1.hasClass('hide')) { |
267 | myScroll && myScroll.scrollTo(0, 0 - imgH); | 265 | myScroll && myScroll.scrollTo(0, 0 - imgH); |
268 | } | 266 | } |
@@ -320,7 +318,6 @@ function scrollHandler() { | @@ -320,7 +318,6 @@ function scrollHandler() { | ||
320 | 318 | ||
321 | var tra; | 319 | var tra; |
322 | 320 | ||
323 | - | ||
324 | theY = sTop; | 321 | theY = sTop; |
325 | if (sTop + winH > scH - 0.25 * $goodsContainer.height() - 50) { | 322 | if (sTop + winH > scH - 0.25 * $goodsContainer.height() - 50) { |
326 | if ($pre !== undefined) { | 323 | if ($pre !== undefined) { |
@@ -439,7 +436,7 @@ document.addEventListener('touchmove', function(e) { | @@ -439,7 +436,7 @@ document.addEventListener('touchmove', function(e) { | ||
439 | 436 | ||
440 | //window ready 后重新refresh iscroll | 437 | //window ready 后重新refresh iscroll |
441 | $(window).ready(function() { | 438 | $(window).ready(function() { |
442 | - //myScroll && myScroll.refresh(); | 439 | + myScroll && myScroll.refresh(); |
443 | imgH = $('#nav-top').outerHeight(); | 440 | imgH = $('#nav-top').outerHeight(); |
444 | nav1H = $('#nav').outerHeight(); | 441 | nav1H = $('#nav').outerHeight(); |
445 | main1H = $('#nav-main').height(); | 442 | main1H = $('#nav-main').height(); |
@@ -454,14 +451,12 @@ $(window).ready(function() { | @@ -454,14 +451,12 @@ $(window).ready(function() { | ||
454 | click: true | 451 | click: true |
455 | }); | 452 | }); |
456 | 453 | ||
457 | - //setTimeout(function() { | 454 | + setTimeout(function() { |
458 | scH = $('#scroller').outerHeight(); | 455 | scH = $('#scroller').outerHeight(); |
459 | - //}, 1000); | 456 | + }, 1000); |
460 | 457 | ||
461 | 458 | ||
462 | - myScroll.on('scroll', function() { | ||
463 | - window.requestAnimationFrame(scrollHandler); | ||
464 | - }); | 459 | + myScroll.on('scroll', scrollHandler); |
465 | 460 | ||
466 | myScroll.on('scrollStart', function() { | 461 | myScroll.on('scrollStart', function() { |
467 | 462 | ||
@@ -478,7 +473,8 @@ $(window).ready(function() { | @@ -478,7 +473,8 @@ $(window).ready(function() { | ||
478 | 473 | ||
479 | multiSwiper && multiSwiper.startAutoplay(); | 474 | multiSwiper && multiSwiper.startAutoplay(); |
480 | 475 | ||
481 | - $('#scroller').trigger('scroll'); | 476 | + // $('#scroller').trigger('scroll'); |
477 | + scrollHandler.bind(this)(); | ||
482 | }); | 478 | }); |
483 | 479 | ||
484 | }); | 480 | }); |
@@ -646,10 +642,7 @@ function search(opt) { | @@ -646,10 +642,7 @@ function search(opt) { | ||
646 | 642 | ||
647 | window.rePosFooter(); | 643 | window.rePosFooter(); |
648 | 644 | ||
649 | - setTimeout(function() { | ||
650 | - myScroll && myScroll.refresh(); | ||
651 | - }, 0); | ||
652 | - | 645 | + myScroll.refresh(); |
653 | reNav1Pos(); | 646 | reNav1Pos(); |
654 | 647 | ||
655 | bindGoodThumbClick(); | 648 | bindGoodThumbClick(); |
@@ -830,14 +823,14 @@ $listNav.on('touchstart', 'li', function(e) { | @@ -830,14 +823,14 @@ $listNav.on('touchstart', 'li', function(e) { | ||
830 | $(this).addClass('bytouch'); | 823 | $(this).addClass('bytouch'); |
831 | }).on('touchend touchcancel', function() { | 824 | }).on('touchend touchcancel', function() { |
832 | $listNav.find('li').removeClass('bytouch'); | 825 | $listNav.find('li').removeClass('bytouch'); |
833 | - //myScroll && myScroll.refresh(); | 826 | + myScroll && myScroll.refresh(); |
834 | }); | 827 | }); |
835 | 828 | ||
836 | $nav2.on('touchstart', 'li', function(e) { | 829 | $nav2.on('touchstart', 'li', function(e) { |
837 | $(this).addClass('bytouch'); | 830 | $(this).addClass('bytouch'); |
838 | }).on('touchend touchcancel', function() { | 831 | }).on('touchend touchcancel', function() { |
839 | $nav2.find('li').removeClass('bytouch'); | 832 | $nav2.find('li').removeClass('bytouch'); |
840 | - //myScroll && myScroll.refresh(); | 833 | + myScroll && myScroll.refresh(); |
841 | }); | 834 | }); |
842 | 835 | ||
843 | //底部导航点击 | 836 | //底部导航点击 |
@@ -900,7 +893,7 @@ function postCollect(info) { | @@ -900,7 +893,7 @@ function postCollect(info) { | ||
900 | } | 893 | } |
901 | 894 | ||
902 | setTimeout(function() { | 895 | setTimeout(function() { |
903 | - //myScroll.refresh(); | 896 | + myScroll.refresh(); |
904 | scH = $('#scroller').outerHeight(); | 897 | scH = $('#scroller').outerHeight(); |
905 | }, 1000); | 898 | }, 1000); |
906 | searching = false; | 899 | searching = false; |
-
Please register or login to post a comment