Browse Source

添加广告模块(效果未完成)

luyanan 7 years ago
parent
commit
e493214898
12 changed files with 146 additions and 142 deletions
  1. 46 43
      articalShow.html
  2. 2 0
      css/common.css
  3. 2 1
      css/genindex.css
  4. 10 23
      discover.html
  5. 46 44
      fw_template_r3254/article.html
  6. 1 0
      js/articalShow.js
  7. 28 3
      js/common.js
  8. 2 2
      js/correctBack.js
  9. 1 1
      js/discover.js
  10. 2 2
      js/scrollfix.js
  11. 1 0
      js/searchNew.js
  12. 5 23
      searchNew.html

+ 46 - 43
articalShow.html

@ -25,44 +25,46 @@
25 25
			<div class="leftconBox floatL">
26 26
				<div class="showDetail">
27 27
					<div class="offmsg">
28
						<div class="h1Font" id="articleTitle"></div>
29
						<div class="h2Font"><span id="publishTime"></span> <span class="readNum" id="pageViews"></span></div>
30
						<div class="showBigOpen" id="articleImg"></div>
31
						<!--文章内容区-->
32
						<div class="showMain" id="articleContent"></div>
33
						<!--标签模块-->
34
						<ul class="tagList" id="tagList">
35
						
36
						</ul>
37
						<!--相关专家-->
38
						<div class="form-item otherShow otherShowFirst displayNone">
39
							<div class="aboutTit">相关专家</div>
40
							<div class="form-result">
41
								<ul id="relevantExperts">
42
									
43
								</ul>
28
						<div style="padding:0 30px;">
29
							<div class="h1Font" id="articleTitle"></div>
30
							<div class="h2Font"><span id="publishTime"></span> <span class="readNum" id="pageViews"></span></div>
31
							<div class="showBigOpen" id="articleImg"></div>
32
							<!--文章内容区-->
33
							<div class="showMain" id="articleContent"></div>
34
							<!--标签模块-->
35
							<ul class="tagList" id="tagList">
36
							
37
							</ul>
38
							<!--相关专家-->
39
							<div class="form-item otherShow otherShowFirst displayNone">
40
								<div class="aboutTit">相关专家</div>
41
								<div class="form-result">
42
									<ul id="relevantExperts">
43
										
44
									</ul>
45
								</div>
44 46
							</div>
45
						</div>
46
						<!--相关资源-->
47
						<div class="form-item otherShow displayNone">
48
							<div class="aboutTit">相关资源</div>
49
							<div class="form-result aboutRes">
50
								<ul id="resources">
51
									
52
								</ul>
47
							<!--相关资源-->
48
							<div class="form-item otherShow displayNone">
49
								<div class="aboutTit">相关资源</div>
50
								<div class="form-result aboutRes">
51
									<ul id="resources">
52
										
53
									</ul>
54
								</div>
53 55
							</div>
54
						</div>
55
						<div class="form-item otherShow displayNone">
56
							<div class="aboutTit">相关企业</div>
57
							<div class="form-result aboutRes">
58
								<ul id="busList">
59
									
60
								</ul>
56
							<div class="form-item otherShow displayNone">
57
								<div class="aboutTit">相关企业</div>
58
								<div class="form-result aboutRes">
59
									<ul id="busList">
60
										
61
									</ul>
62
								</div>
63
							</div>
64
							<!--点赞模块-->
65
							<div class="thumbBlock">
66
								<span class="thumbBtn thunbgo">赞</span>
61 67
							</div>
62
						</div>
63
						<!--点赞模块-->
64
						<div class="thumbBlock">
65
							<span class="thumbBtn thunbgo">赞</span>
66 68
						</div>
67 69
						<!--分享操作栏-->
68 70
						<div class="shareBlock clearfix">
@ -95,9 +97,7 @@
95 97
						</div>
96 98
						<div class="share-bottom"></div>
97 99
					</div>
98
					<div class="form-item commentsArea swiper-container advertItem advertItem_bottom">
99

100
					</div>
100
					<div class="form-item commentsArea swiper-container advertItem advertItem-C"></div>
101 101
					<div class="ifLogin" id="messagego">
102 102
					    <!--未登录-->
103 103
					    <div class="ifLoginUn displayNone">
@ -132,6 +132,7 @@
132 132
							</ul>
133 133
						</div>
134 134
					</div>
135
					<div class="form-item commentsArea swiper-container advertItem advertItem-D"></div>
135 136
				</div>
136 137
			</div>
137 138
			
@ -184,8 +185,9 @@
184 185
						</div>
185 186
					</div>	
186 187
				</div>
187
				<div class="conItem advertBox advertItem advertItem_right">
188
					
188
				<div id="scroll-fixed-ad">
189
					<div class="conItem advertBox advertItem advertItem-A"></div>
190
					<div class="conItem advertBox advertItem advertItem-B"></div>
189 191
				</div>
190 192
			</div>
191 193
		</div>
@ -207,10 +209,11 @@
207 209
<script type="text/javascript" src="js/quickLogin.js"></script>
208 210
<script type="text/javascript">
209 211
	$(function() {
210
		addscript("ad_article_right");
211
		addscript("ad_article_bottom");
212
		addscript("ad_article_web_a");
213
		addscript("ad_article_web_b");
214
		addscript("ad_article_web_c");
215
		addscript("ad_article_web_d");
212 216
		
213
//		$('.upTop').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); //置顶
214 217
		$('.wordHave').click(function(){$('html,body').animate({scrollTop: ($('.offmsg').outerHeight(true)+60)+'px'}, 800);}); //留言
215 218
		$('.shareWeixin').hover(function(){$('.shareCode').stop(true,false).fadeToggle();});//微信分享
216 219
		//微信分享

+ 2 - 0
css/common.css

@ -223,3 +223,5 @@ header .icon4{ background:url(../images/index-icon.png) no-repeat; background-po
223 223
.advertsub{position: relative;display: block;margin-bottom: 10px;}
224 224
.advertsub:after{content:"广告";font-size:10px;color:#fff;background:rgba(0,0,0,0.3);position:absolute;padding:0 4px;right:0;bottom:0px;}
225 225

226
.div2{top:80px;bottom:auto;z-index:999;position:fixed;_position:absolute}
227
.div3{z-index:999;position:fixed;_position:absolute}

+ 2 - 1
css/genindex.css

@ -421,7 +421,8 @@ ul.tagList>li .h2Font{color:#666;font-size:14px;line-height:30px;}
421 421
.thumbBlock .thumbBtn:hover{opacity: 1;}
422 422
.thumbBlock .thumbBtn.thumbedBtn{background-color: #e0e0e0;opacity: 1;}
423 423
/*分享操作栏*/
424
.shareBlock{background:rgba(60,62,81,.5);margin:0 -30px;padding:14px 30px;}
424
.offmsg{margin:0 -30px;}
425
.shareBlock{background:rgba(60,62,81,.5);padding:14px 30px;}
425 426
.shareInfo>a{position: relative;display:block;}
426 427
.shareInfo .madiaHead{border-color:#999}
427 428
.shareInfo .madiaInfo{margin-top:8px;}

+ 10 - 23
discover.html

@ -103,7 +103,7 @@
103 103
<div id="container" style="margin-top:-20px;">
104 104
	<div class="containerCon">
105 105
		<div class="contentCon clearfix">
106
			<div class="leftconBox floatL" style="background: #f4f6f8;">
106
			<div class="leftconBox floatL" style="background: #f4f6f8;padding-bottom:0">
107 107
				<div class="slide-box clearfix">
108 108

109 109
				</div>
@ -207,15 +207,15 @@
207 207
						</div>
208 208
					</div>	
209 209
				</div>
210
				<div class="conItem advertBox advertItem advertItem-B"></div>
211
				<div class="conItem advertBox advertItem advertItem-C"></div>
210
				<div id="scroll-fixed-ad">
211
					<div class="conItem advertBox advertItem advertItem-B"></div>
212
					<div class="conItem advertBox advertItem advertItem-C"></div>
213
				</div>
212 214
			</div>
213 215
		</div>
214 216
	</div>
215 217
</div>
216
<div class="footer_tools">
217
  <a id="scrollUp" href="javascript:;" title="返回顶部"></a>
218
</div>
218
<script type="text/javascript" src="js/correctBack.js"></script>
219 219
<footer>
220 220
	<script type="text/javascript" src="js/footer.js"></script>
221 221
</footer>
@ -226,29 +226,16 @@
226 226
<script type="text/javascript" src="./js/webuploader/webuploader.js"></script>
227 227
<script type="text/javascript" src="js/common.js"></script>
228 228
<script type="text/javascript" src="js/quickLogin.js"></script>
229
<script type="text/javascript" src="js/scrollfix.js"></script>
229 230
<script type="text/javascript" src="js/discover.js"></script>
230 231
<script type="text/javascript">
231 232
$(function () {	
232 233
	addscript("ad_discover_a");
233 234
	addscript("ad_discover_b");
234
	addscript("ad_discover_c");
235
	//回到顶部
236
	var $body = $(document.body);;
237
	var $bottomTools = $('.footer_tools');
238
	$(window).scroll(function () {
239
		var scrollHeight = $(document).height();
240
		var scrollTop = $(window).scrollTop();
241
		var $footerHeight = $('footer').outerHeight(true);
242
		var $windowHeight = $(window).innerHeight();
243
		scrollTop > 50 ? $("#scrollUp").fadeIn(200).css("display","block") : $("#scrollUp").fadeOut(200);			
244
		$bottomTools.css("bottom", scrollHeight - scrollTop - $footerHeight > $windowHeight ? 20 : $windowHeight + scrollTop + $footerHeight + 20 - scrollHeight);
245
	});
246
	$('#scrollUp').click(function (e) {
247
		e.preventDefault();
248
		$('html,body').animate({ scrollTop:0});
249
	});
250

235
	addscript("ad_discover_c");	
236
	adScroll()
251 237
});
238

252 239
</script>
253 240
</body>
254 241
</html>

+ 46 - 44
fw_template_r3254/article.html

@ -29,44 +29,46 @@
29 29
			<div class="leftconBox floatL">
30 30
				<div class="showDetail">
31 31
					<div class="offmsg">
32
						<div class="h1Font" id="articleTitle">${data.articleTitle}</div>
33
						<div class="h2Font"><span id="publishTime"></span> <span class="readNum" id="pageViews"></span></div>
34
						<div class="showBigOpen" id="articleImg"></div>
35
						<!--文章内容区-->
36
						<div class="showMain" id="articleContent"></div>
37
						<!--标签模块-->
38
						<ul class="tagList" id="tagList">
39
						
40
						</ul>
41
						<!--相关专家-->
42
						<div class="form-item otherShow otherShowFirst displayNone">
43
							<div class="aboutTit">相关专家</div>
44
							<div class="form-result">
45
								<ul id="relevantExperts">
46
									
47
								</ul>
32
						<div style="padding:0 30px;">
33
							<div class="h1Font" id="articleTitle">${data.articleTitle}</div>
34
							<div class="h2Font"><span id="publishTime"></span> <span class="readNum" id="pageViews"></span></div>
35
							<div class="showBigOpen" id="articleImg"></div>
36
							<!--文章内容区-->
37
							<div class="showMain" id="articleContent"></div>
38
							<!--标签模块-->
39
							<ul class="tagList" id="tagList">
40
							
41
							</ul>
42
							<!--相关专家-->
43
							<div class="form-item otherShow otherShowFirst displayNone">
44
								<div class="aboutTit">相关专家</div>
45
								<div class="form-result">
46
									<ul id="relevantExperts">
47
										
48
									</ul>
49
								</div>
48 50
							</div>
49
						</div>
50
						<!--相关资源-->
51
						<div class="form-item otherShow displayNone">
52
							<div class="aboutTit">相关资源</div>
53
							<div class="form-result aboutRes">
54
								<ul id="resources">
55
									
56
								</ul>
51
							<!--相关资源-->
52
							<div class="form-item otherShow displayNone">
53
								<div class="aboutTit">相关资源</div>
54
								<div class="form-result aboutRes">
55
									<ul id="resources">
56
										
57
									</ul>
58
								</div>
57 59
							</div>
58
						</div>
59
						<div class="form-item otherShow displayNone">
60
							<div class="aboutTit">相关企业</div>
61
							<div class="form-result aboutRes">
62
								<ul id="busList">
63
									
64
								</ul>
60
							<div class="form-item otherShow displayNone">
61
								<div class="aboutTit">相关企业</div>
62
								<div class="form-result aboutRes">
63
									<ul id="busList">
64
										
65
									</ul>
66
								</div>
67
							</div>
68
							<!--点赞模块-->
69
							<div class="thumbBlock">
70
								<span class="thumbBtn thunbgo">赞</span>
65 71
							</div>
66
						</div>
67
						<!--点赞模块-->
68
						<div class="thumbBlock">
69
							<span class="thumbBtn thunbgo">赞</span>
70 72
						</div>
71 73
						<!--分享操作栏-->
72 74
						<div class="shareBlock clearfix">
@ -99,9 +101,7 @@
99 101
						</div>
100 102
						<div class="share-bottom"></div>
101 103
					</div>
102
					<div class="form-item commentsArea swiper-container advertItem advertItem_bottom">
103

104
					</div>
104
					<div class="form-item commentsArea swiper-container advertItem advertItem-C"></div>
105 105
					
106 106
					<div class="ifLogin" id="messagego">
107 107
					    <!--未登录-->
@ -137,6 +137,7 @@
137 137
							</ul>
138 138
						</div>
139 139
					</div>
140
					<div class="form-item commentsArea swiper-container advertItem advertItem-D"></div>
140 141
				</div>
141 142
			</div>
142 143
			
@ -189,9 +190,8 @@
189 190
						</div>
190 191
					</div>	
191 192
				</div>
192
				<div class="conItem advertBox advertItem advertItem_right">
193
					
194
				</div>
193
				<div class="conItem advertBox advertItem advertItem-A"></div>
194
				<div class="conItem advertBox advertItem advertItem-B"></div>
195 195
			</div>
196 196
		</div>
197 197
	</div>
@ -211,9 +211,11 @@
211 211
<script type="text/javascript" src="/js/quickLogin.js"></script>
212 212
<script type="text/javascript">
213 213
	$(function() {
214
		addscript("ad_article_right");
215
		addscript("ad_article_bottom");
216
//		$('.upTop').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); //置顶
214
		addscript("ad_article_web_a");
215
		addscript("ad_article_web_b");
216
		addscript("ad_article_web_c");
217
		addscript("ad_article_web_d");
218
		
217 219
		$('.wordHave').click(function(){$('html,body').animate({scrollTop: ($('.offmsg').outerHeight(true)+60)+'px'}, 800);}); //留言
218 220
		$('.shareWeixin').hover(function(){$('.shareCode').stop(true,false).fadeToggle();});//微信分享
219 221
		//微信分享

+ 1 - 0
js/articalShow.js

@ -14,6 +14,7 @@ $(function() {
14 14
	articleshow();
15 15
	relevantExperts();
16 16
	relevantResources(); 
17
	adScroll()
17 18
	wlog("article",articleId,"1");
18 19
	//判断是否登录转态
19 20
	if(userid && userid != "null" && userid != null){

+ 28 - 3
js/common.js

@ -8,11 +8,9 @@ $(document).ready(function() {
8 8
	var footerHeight = $("footer").outerHeight(true);
9 9
	$('#container').css("padding-bottom", footerHeight + "px");
10 10
	$(".footer_tools").css("bottom", (footerHeight+10) + "px");
11
	//窗口大小变更事件
12
	$(window).resize(function() {
11
	$(window).resize(function() {//窗口大小变更事件
13 12
		footerHeight = $("footer").outerHeight(true);
14 13
		$('#container').css("padding-bottom", footerHeight + "px");
15
		//console.log(footerHeight)
16 14
	});
17 15
	//底部企业入驻
18 16
	var orgid = $.cookie('orgId');
@ -1287,3 +1285,30 @@ $(document).ready(function(){
1287 1285
		return true;	
1288 1286
	})
1289 1287
})
1288

1289
function adScroll(){
1290
	//不随滚动条滚动的固定层广告代码
1291
	function thisS() {
1292
		var scrollHeight = $(document).height();
1293
		var windowHeight = $(window).innerHeight();
1294
		var footerHeight = $("footer").outerHeight(true);
1295
		var containH = $("#container").outerHeight(true)-footerHeight
1296
		var scroTop = $(window).scrollTop();
1297
		(scroTop+offTop-120) < containH ? (scroTop > offTop ? 
1298
			(scroObj.attr('class',"div1 div2"), c && (scroObj.style.top = scroTop - offTop + "px")) :scroObj.attr('class',"div1")):
1299
					(scroObj.attr('class',"div1 div3"),scroObj.css("bottom",windowHeight + scroTop + footerHeight+ 10 - scrollHeight))
1300
	console.log("***"+(scroTop+offTop-120))
1301
	}
1302
	var scroObj = $("#scroll-fixed-ad");
1303
	var offTop=scroObj.offset().top + 40;
1304
	if(scroObj == undefined) return !1;
1305
	var c;
1306
	c = window.ActiveXObject && !window.XMLHttpRequest;
1307
	if(!c || !0) window.onscroll =function(){
1308
		var d;
1309
		if(d) return;
1310
		d = setTimeout(function() {
1311
			thisS.call(this), d = undefined
1312
		}, 150)
1313
	}
1314
}

+ 2 - 2
js/correctBack.js

@ -15,7 +15,7 @@ Html +='<div class="footer_tools">'+
15 15
document.write(Html);
16 16
$(function() {
17 17
  //回到顶部
18
	var $body = $(document.body);;
18
	var $body = $(document.body);
19 19
	var $bottomTools = $('.footer_tools');
20 20
	$(window).scroll(function () {
21 21
		var scrollHeight = $(document).height();
@ -23,7 +23,7 @@ $(function() {
23 23
		var $footerHeight = $('footer').outerHeight(true);
24 24
		var $windowHeight = $(window).innerHeight();
25 25
		scrollTop > 50 ? $("#scrollUp").fadeIn(200).css("display","block") : $("#scrollUp").fadeOut(200);			
26
		$bottomTools.css("bottom", scrollHeight - scrollTop - $footerHeight > $windowHeight ? 20 : $windowHeight + scrollTop + $footerHeight + 20 - scrollHeight);
26
		$bottomTools.css("bottom", scrollHeight - scrollTop - $footerHeight > $windowHeight ? 30 : $windowHeight + scrollTop + $footerHeight + 30 - scrollHeight);
27 27
	});
28 28
	$('#scrollUp').click(function (e) {
29 29
		e.preventDefault();

+ 1 - 1
js/discover.js

@ -1,6 +1,7 @@
1 1
//发现模块
2 2
$(function() {
3 3
	$(".headnav li").eq(1).addClass("navcurrent");
4
	$("#feedback").hide();
4 5
	loginStatus();//判断个人是否登录
5 6
	var userid = $.cookie("userid");
6 7
	var exculdeIds=[];
@ -440,7 +441,6 @@ $(function() {
440 441
                        $("#table-item-" + idItem).parent().find(".js-load-more").unbind("click");
441 442
                        $("#table-item-" + idItem).parent().find(".js-load-more").hide();
442 443
					}
443
					$(".loading").remove();
444 444
				}
445 445
			},
446 446
			"error":function(){

+ 2 - 2
js/scrollfix.js

@ -58,12 +58,12 @@
58 58
			function resetScroll() {
59 59
				setUnfixed();
60 60
				selfTop = obj.offset().top; //对象距离顶部高度
61
				selfLeft = obj.offset().left+30; //对象距离左边宽度
61
				selfLeft = obj.offset().left; //对象距离左边宽度
62 62
				outerHeight = obj.outerHeight(); //对象高度
63 63
				outerHeight = parseFloat(outerHeight) + parseFloat(obj.css('marginBottom').replace(/auto/, 0));
64 64
				outerWidth = obj.outerWidth(); //对象外宽度
65 65
				//objWidth = obj.width();
66
				objWidth = obj.outerWidth(true)+60;
66
				objWidth = obj.outerWidth(true);
67 67
				var documentHeight = $(document).height(); //文档高度
68 68
				var startTop = $(opts.startTop), //开始浮动固定对象
69 69
					startBottom = $(opts.startBottom),

+ 1 - 0
js/searchNew.js

@ -2,6 +2,7 @@ $(function() {
2 2
	if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
3 3
	 	location.href="http://" + window.location.host + "/e/search.html";
4 4
	}
5
	$("#feedback").hide();
5 6
	loginStatus();//判断个人是否登录
6 7
	var userid = $.cookie("userid");
7 8
	var num;

+ 5 - 23
searchNew.html

@ -159,16 +159,13 @@
159 159
				</div>
160 160
			</div>
161 161
			<div class="rightconBox floatR">
162
				<div class="conItem advertBox advertItem">
163
					
164
				</div>
162
				<div class="conItem advertBox advertItem advertItem-A"></div>
163
				<div class="conItem advertBox advertItem advertItem-B"></div>
165 164
			</div>
166 165
		</div>
167 166
	</div>
168 167
</div>
169
<div class="footer_tools">
170
  <a id="scrollUp" href="javascript:;" title="返回顶部"></a>
171
</div>
168
<script type="text/javascript" src="js/correctBack.js"></script>
172 169
<footer>
173 170
	<script type="text/javascript" src="js/footer.js"></script>
174 171
</footer>
@ -179,23 +176,8 @@
179 176
<script type="text/javascript" src="js/searchNew.js"></script>
180 177
<script type="text/javascript">
181 178
$(function () {
182
	addscript("ad_search");
183
	//回到顶部
184
	var $body = $(document.body);;
185
	var $bottomTools = $('.footer_tools');
186
	$(window).scroll(function () {
187
		var scrollHeight = $(document).height();
188
		var scrollTop = $(window).scrollTop();
189
		var $footerHeight = $('footer').outerHeight(true);
190
		var $windowHeight = $(window).innerHeight();
191
		scrollTop > 50 ? $("#scrollUp").fadeIn(200).css("display","block") : $("#scrollUp").fadeOut(200);			
192
		$bottomTools.css("bottom", scrollHeight - scrollTop - $footerHeight > $windowHeight ? 20 : $windowHeight + scrollTop + $footerHeight + 20 - scrollHeight);
193
	});
194
	$('#scrollUp').click(function (e) {
195
		e.preventDefault();
196
		$('html,body').animate({ scrollTop:0});
197
	});
198

179
	addscript("ad_search_a");
180
	addscript("ad_search_b");
199 181
});
200 182
</script>
201 183
</body>