Authored by QC-L

完成 tab 悬浮效果

1 -<div class="guess-like"> 1 +<div id='fixedTab' class="guess-like">
2 <div class="wapper"> 2 <div class="wapper">
3 <div class="guess-scroll"> 3 <div class="guess-scroll">
4 {{#each data}} 4 {{#each data}}
@@ -24,7 +24,8 @@ class Group extends Page { @@ -24,7 +24,8 @@ class Group extends Page {
24 resourceList: $('.resource-collage-buy-prd-list'), 24 resourceList: $('.resource-collage-buy-prd-list'),
25 resourceListC: $('.resource-collage-buy-prd-list-c'), 25 resourceListC: $('.resource-collage-buy-prd-list-c'),
26 goodsList: $('.new-goods-list'), 26 goodsList: $('.new-goods-list'),
27 - guessLike: $('.guess-tab') 27 + guessLike: $('.guess-tab'),
  28 + guessLikeHeight: $('guess-tab').height()
28 }; 29 };
29 this.shareData = { 30 this.shareData = {
30 shareImgUrl: $('.group').data('share-img'), 31 shareImgUrl: $('.group').data('share-img'),
@@ -142,9 +143,11 @@ class Group extends Page { @@ -142,9 +143,11 @@ class Group extends Page {
142 if ($(window).scrollTop() > floorsContentHeight) { 143 if ($(window).scrollTop() > floorsContentHeight) {
143 this.selector.tabSection.addClass('float'); 144 this.selector.tabSection.addClass('float');
144 this.selector.groupListContent.css('marginTop', this.selector.tabSectionHeight); 145 this.selector.groupListContent.css('marginTop', this.selector.tabSectionHeight);
  146 + this.selector.goodsList.css('marginTop', this.selector.guessLikeHeight);
145 } else { 147 } else {
146 this.selector.tabSection.removeClass('float'); 148 this.selector.tabSection.removeClass('float');
147 this.selector.groupListContent.css('marginTop', 0); 149 this.selector.groupListContent.css('marginTop', 0);
  150 + this.selector.goodsList.css('marginTop', 0);
148 } 151 }
149 } 152 }
150 153
@@ -152,6 +155,7 @@ class Group extends Page { @@ -152,6 +155,7 @@ class Group extends Page {
152 scrollListHandler() { 155 scrollListHandler() {
153 let floorsContentHeight = this.selector.floorsContentHeight + 5; 156 let floorsContentHeight = this.selector.floorsContentHeight + 5;
154 let goodsContainerHeight = this.selector.groupListContent.height(); 157 let goodsContainerHeight = this.selector.groupListContent.height();
  158 + let goodsListHeight = this.selector.goodsList.height();
155 let navType = this.judgeType(this.filterTab[this.selectedChannel].$pre); 159 let navType = this.judgeType(this.filterTab[this.selectedChannel].$pre);
156 let newNavType = this.judgeNavType(this.newFilterTab); 160 let newNavType = this.judgeNavType(this.newFilterTab);
157 let nav = this.navInfo[navType]; 161 let nav = this.navInfo[navType];
@@ -165,7 +169,9 @@ class Group extends Page { @@ -165,7 +169,9 @@ class Group extends Page {
165 this.search(); 169 this.search();
166 } 170 }
167 } 171 }
  172 + }
168 173
  174 + if (($(window).scrollTop() - floorsContentHeight) > goodsListHeight * 0.6) {
169 if (newNav) { 175 if (newNav) {
170 newNav.reload = false; 176 newNav.reload = false;
171 newNav.isScrollLoad = true; 177 newNav.isScrollLoad = true;
@@ -40,3 +40,12 @@ @@ -40,3 +40,12 @@
40 40
41 .wapper::-webkit-scrollbar { width: 0 !important; } 41 .wapper::-webkit-scrollbar { width: 0 !important; }
42 } 42 }
  43 +
  44 +.guess-like.float {
  45 + position: fixed;
  46 + top: 0;
  47 + left: 0;
  48 + right: 0;
  49 + z-index: 998;
  50 + background-color: #fff;
  51 +}