Browse Source

文章留言样式调整,去掉console

luyanan 8 years ago
parent
commit
4092603c1a
2 changed files with 13 additions and 46 deletions
  1. 1 1
      css/index.css
  2. 12 45
      js/articalInfo.js

+ 1 - 1
css/index.css

@ -496,7 +496,7 @@ label.edu-radio{ float:none;font-size:16px;line-height:26px; color:#868686; }
496 496
.share-nav .shareCode{position: absolute;top:-166px;left: 50%;margin-left: -80px;display: none;width: 160px;height:160px;}
497 497
.share-nav .shareCode img{width: 100%;}
498 498
.share-nav .shareBtn:hover{background: #52DA4D;color: #FFFFFF;}
499
.share-nav .wordHave{background: url(../images/wrapIcon.png) 0 -46px no-repeat; background-size:100% auto ;}
499
.share-nav .wordHave{background: url(../images/wrapIcon.png) 0 -47px no-repeat; background-size:100% auto ;}
500 500
.share-nav .wordHave:hover{background: url(../images/wrapIcon.png) 0 -69px no-repeat; background-size:100% auto;}
501 501
.share-nav .listtit2{line-height: 40px;margin-left:10px;width:86%;color:#888;text-overflow:ellipsis;white-space: nowrap; overflow:hidden;}
502 502


+ 12 - 45
js/articalInfo.js

@ -142,52 +142,19 @@ $(document).ready(function() {
142 142
						}
143 143
					}
144 144
				}
145
				//留言分享操作栏
146
//				var containerH=$("#container").height();
147
//				var resTop=$(".resTop").height();
148
//				var mainH=$('#main_content').height();
149
//				$(document).scroll(function(){
150
//					var top=$(document).scrollTop();
151
//					console.log(containerH-resTop-80);
152
//					console.log(top);
153
//					console.log(mainH);
154
//					if (top <= containerH-resTop-80 && top> mainH) {
155
//						$('.share-nav').addClass('fixed');
156
//					} else{
157
//						$('.share-nav').removeClass('fixed');
158
//					}
159
//				});
145
				//留言分享操作栏				
146
				var height=$(".resTop").height()-$(window).height();
147
				var mainH = $("body");
148
				$(window).scroll( function() { 
149
					//console.log(height,mainH.scrollTop())
150
				   if(mainH.scrollTop()>=height){
151
				   	$('.share-nav').removeClass('fixed');
152
				   }
153
				   if(mainH.scrollTop()<height){
154
				   	$('.share-nav').addClass('fixed');
155
				   }
156
				} );
160 157
				
161
			var height=$(".resTop").height()-$(window).height();
162
			var mainH = $("body");
163
			$(window).scroll( function() { 
164
				console.log(height,mainH.scrollTop())
165
			   if(mainH.scrollTop()>=height){
166
			   	$('.share-nav').removeClass('fixed');
167
			   }
168
			   if(mainH.scrollTop()<height){
169
			   	$('.share-nav').addClass('fixed');
170
			   }
171
			} );
172
	
173
						
174
//						var wTop=$(window).height();
175
//						var resTop=$(".resTop").height();
176
//						var o=$(".share-nav");
177
//						var oHeight=o.height();
178
//
179
//						$(document).scroll(function(){
180
//							var aTop=$(window).scrollTop();
181
//							if(aTop>=oHeight && aTop<= (oHeight+wTop-400) || aTop<=oHeight && aTop>=(oHeight-resTop)){
182
//								var l=o.offset().top;
183
//								l+oHeight>aTop+wTop-resTop?o.addClass("fixed"):o.removeClass("fixed")
184
//								
185
//							}else{
186
//								o.removeClass("fixed")
187
//								
188
//							}
189
//						})
190
					
191 158
					
192 159
			},
193 160
			error: function() {