瀏覽代碼

Merge branch 'dev' of http://121.42.53.174:3000/jiapeng/portal-front.git into dev

happy 8 年之前
父節點
當前提交
ca5febd6b7
共有 9 個文件被更改,包括 307 次插入78 次删除
  1. 3 3
      css/index.css
  2. 1 1
      css/workspace.css
  3. 1 1
      ekexiu/shareArticalinfor.html
  4. 15 15
      js/articalInfo.js
  5. 63 55
      js/information.brow.js
  6. 1 1
      js/information.js
  7. 1 1
      js/news-list.js
  8. 221 0
      js/scrollfix.js
  9. 1 1
      js/workindex.js

+ 3 - 3
css/index.css

@ -463,7 +463,7 @@ label.edu-radio{ float:none;font-size:16px;line-height:26px; color:#868686; }
463 463
.resBrief2 .subtit{line-height: 42px; }
464 464
.resBrief2 .resAbout{margin-bottom: 20px;}
465 465
.art_topicBox{position: relative;display: block;}
466
.art_topicbox{ position:absolute;top:0;width:100%;height:100%;
466
.art_tbox{ position:absolute;top:0;width:100%;height:100%;
467 467
	background: -webkit-linear-gradient( rgba(0,0,0,0), rgba(0,0,0,0.2)); /* Safari 5.1 - 6.0 */
468 468
	background: -o-linear-gradient( rgba(0,0,0,0), rgba(0,0,0,0.2)); /* Opera 11.1 - 12.0 */
469 469
	background: -moz-linear-gradient( rgba(0,0,0,0), rgba(0,0,0,0.2)); /* Firefox 3.6 - 15 */
@ -492,10 +492,10 @@ label.edu-radio{ float:none;font-size:16px;line-height:26px; color:#868686; }
492 492
.share-nav .wrapicon{display: inline-block;cursor:pointer;padding:0 10px;width: 24px;height: 24px;}
493 493
.share-nav .upTop{background: url(../images/wrapIcon.png) 0 0 no-repeat; background-size:100% auto ;}
494 494
.share-nav .upTop:hover{background: url(../images/wrapIcon.png) 0 -24px no-repeat; background-size:100% auto ;}
495
.share-nav .shareBtn{display: inline-block;position:relative;border:1px solid #52DA4D;color: #52DA4D; border-radius: 999em;cursor:pointer;padding:2px 24px;}
495
.share-nav .shareBttn{display: inline-block;position:relative;border:1px solid #52DA4D;color: #52DA4D; border-radius: 999em;cursor:pointer;padding:2px 24px;}
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
.share-nav .shareBtn:hover{background: #52DA4D;color: #FFFFFF;}
498
.share-nav .shareBttn:hover{background: #52DA4D;color: #FFFFFF;}
499 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;}

+ 1 - 1
css/workspace.css

@ -118,7 +118,7 @@
118 118
.otherRes li:last-child{margin:0 0 12px 0;}
119 119
.otherRes li a{display: block;}
120 120
.art_topicBox{position: relative;display: block;}
121
.art_topicbox{ position:absolute;top:0;width:100%;height:100%;
121
.art_tbox{ position:absolute;top:0;width:100%;height:100%;
122 122
	background: -webkit-linear-gradient( rgba(0,0,0,0), rgba(0,0,0,0.2)); /* Safari 5.1 - 6.0 */
123 123
	background: -o-linear-gradient( rgba(0,0,0,0), rgba(0,0,0,0.2)); /* Opera 11.1 - 12.0 */
124 124
	background: -moz-linear-gradient( rgba(0,0,0,0), rgba(0,0,0,0.2)); /* Firefox 3.6 - 15 */

+ 1 - 1
ekexiu/shareArticalinfor.html

@ -27,7 +27,7 @@
27 27
		<div class="contentBody2">
28 28
			<div class="art_topicBox">
29 29
				<div class="art_img" id="articleImg"></div>
30
				<div class="art_topicbox">
30
				<div class="art_tbox">
31 31
					<h4 id="artical_topic"></h4>
32 32
				</div>
33 33
			</div>

+ 15 - 15
js/articalInfo.js

@ -143,20 +143,19 @@ $(document).ready(function() {
143 143
						}
144 144
					}
145 145
				}
146
				//留言分享操作栏				
147
				var height=$(".resTop").height()-$(window).height();
148
				var mainH = $("body");
149
				$(window).scroll( function() { 
150
					//console.log(height,mainH.scrollTop())
151
				   if(mainH.scrollTop()>=height){
152
				   	$('.share-nav').removeClass('fixed');
153
				   }
154
				   if(mainH.scrollTop()<height){
155
				   	$('.share-nav').addClass('fixed');
156
				   }
157
				} );
158
				
159
					
146
//				//留言分享操作栏				
147
//				var height=$(".resTop").height()-$(window).height();
148
//				var mainH = $("body");
149
//				$(window).scroll( function() { 
150
//					//console.log(height,mainH.scrollTop())
151
//				   if(mainH.scrollTop()>=height){
152
//				   	$('.share-nav').removeClass('fixed');
153
//				   }
154
//				   if(mainH.scrollTop()<height){
155
//				   	$('.share-nav').addClass('fixed');
156
//				   }
157
//				} );
158
		
160 159
			},
161 160
			error: function() {
162 161
				return;
@ -206,7 +205,7 @@ $(document).ready(function() {
206 205
							add += '<a href="articalInfo.html?articleId=' + $data[i].articleId + '&professorId=' + professorId + '">'
207 206
							add += '<div class="art_topicBox">'
208 207
							add += '<div class="art_img"style="background:url(' + articleImg + ') center center no-repeat"></div>'
209
							add += '<div class="art_topicbox">'
208
							add += '<div class="art_tbox">'
210 209
							add += '<h6 id="artical_topic" >' + $data[i].articleTitle + '</h6>'
211 210
							add += '</div>'
212 211
							add += '</div>'
@ -329,4 +328,5 @@ $(document).ready(function() {
329 328
	proArticle();
330 329
	message();
331 330
	userInformation();
331
	
332 332
})

+ 63 - 55
js/information.brow.js

@ -627,62 +627,69 @@ $(function() {
627 627
						$("a:contains('荣誉及奖项')").hide();
628 628
					}
629 629
630
					//下滑滚动不覆盖底部 
631
					var d;
632
					var t;
633
					$(function() {
634
						/*向下滚动时,header背景变半透明*/
635
						var top5 = $(".content-left").height();
636
637
						var top4 = $("#container").height();
638
						var top3 = $(window).height();
639
						$(document).scroll(function() {
640
							var top1 = $(document).scrollTop();
641
							var top2 = $("#container").height() - top3 + (top3 - 80 - top5) - 10; //变成绝对定位	
642
							if(top1 >= 300) {
643
								$(".content-left").css({
644
									"position": "fixed",
645
									"top": "80px"
646
								});
647
								if(top1 >= top2) {
648
									$('.information-content').css("position", "static");
649
									$(".content-left").css("position", "absolute");
650
									$(".content-left").css("top", top4 - top5 - 10 + "px");
651
								} else {
652
									$('.information-content').css("position", "relative");
653
									$(".content-left").css({
654
										"position": "fixed",
655
										"top": "80px"
656
									});
657
								}
658
							} else {
659
								$(".content-left").css({
660
									"position": "static"
661
								});
662
							}
630
//下滑滚动不覆盖底部 
631
	var d;
632
	var t;
633
	$(function() {
634
		var art_height;
635
		var isHidden=$("#reA").is(":hidden");//是否隐藏
636
		if(isHidden) {
637
			art_height=0;
638
		}else{
639
			art_height=$("#reA").outerHeight(true);
640
		}
641
		
642
		$(document).scroll(function() {
643
			var top3 = $(window).height();
644
			var top5 = $(".content-left").height();
645
			var top4 = $("#container").height() + art_height;
646
			//console.log(top5+","+top4+","+top3);
647
			var top1 = $(document).scrollTop();
648
			var top2 = $("#container").height() - top3 + (top3 - 80 - top5) - 10; //变成绝对定位	
649
			if(top1 >= 300) {
650
				$(".content-left").css({
651
					"position": "fixed",
652
					"top": "80px"
653
				});
654
				if(top1 >= top2) {
655
					$('.information-content').css("position", "static");
656
					$(".content-left").css("position", "absolute");
657
					$(".content-left").css("top", top4 - top5 - 10 + "px");
658
				} else {
659
					$('.information-content').css("position", "relative");
660
					$(".content-left").css({
661
						"position": "fixed",
662
						"top": "80px"
663
					});
664
				}
665
			} else {
666
				$(".content-left").css({
667
					"position": "static"
668
				});
669
			}
663 670
664
							//咨询框弹出
665
							var foot_height = $(".footerblock").height();
671
			//咨询框弹出
672
			var foot_height = $(".footerblock").height();
673
			if(top1 >= 180 && top1 < top4 - top3) {
674
				$(".coulstblock").slideDown();
675
				$(".coulstblock").css({
676
					"bottom": "0"
677
				});
678
			} else if(top1 >= top4 - top3) {
679
				$(".coulstblock").css({
680
					"bottom": -(top4 - top3 - top1 ) - art_height + "px"
681
				});
682
			} else {
683
				$(".coulstblock").slideUp();
684
				$(".coulstblock").css({
685
					"bottom": "0"
686
				});
687
			}
666 688
667
							if(top1 >= 180 && top1 < top4 - top3) {
668
								$(".coulstblock").slideDown();
669
								$(".coulstblock").css({
670
									"bottom": "0"
671
								});
672
							} else if(top1 >= top4 - top3) {
673
								$(".coulstblock").css({
674
									"bottom": -(top4 - top3 - top1) + "px"
675
								});
676
							} else {
677
								$(".coulstblock").slideUp();
678
								$(".coulstblock").css({
679
									"bottom": "0"
680
								});
681
							}
689
		})
690
	});
691
	//下滑滚动不覆盖底部 结束
682 692
683
						})
684
					});
685
					//下滑滚动不覆盖底部 结束
686 693
				}
687 694
			}
688 695
		});
@ -744,7 +751,7 @@ $(function() {
744 751
					for(var i = 0; i < data.data.length; i++) {
745 752
						var add = '<li><a href="articalInfo.html?articleId=' + data.data[i].articleId + '&professorId=' + professorId + '" style="display:block;">'
746 753
						add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
747
						add += '<div class="art_topicbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
754
						add += '<div class="art_tbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
748 755
						add += '</div><div class="tagsBox"><span></span></div>'
749 756
						add += '</a></li>';
750 757
						$add = $(add);
@ -767,8 +774,8 @@ $(function() {
767 774
		}
768 775
	});
769 776
	var resou;
777
	
770 778
	//科研资源
771
772 779
	$.ajax({
773 780
		"url": "/ajax/resource/qapro",
774 781
		"type": "get",
@ -1162,4 +1169,5 @@ $(function() {
1162 1169
		});
1163 1170
	}
1164 1171
1172
		
1165 1173
})

+ 1 - 1
js/information.js

@ -2122,7 +2122,7 @@ $(function() {
2122 2122
					for(var i = 0; i < data.data.length; i++) {
2123 2123
						var add = '<li style="cursor:auto">'
2124 2124
						add += '<div class="art_topicBox"><div class="art_img" style="cursor:auto"></div>'
2125
						add += '<div class="art_topicbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
2125
						add += '<div class="art_tbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
2126 2126
						add += '</div><div class="tagsBox"><span></span></div>'
2127 2127
						add += '</li>';
2128 2128
						$add = $(add);

+ 1 - 1
js/news-list.js

@ -53,7 +53,7 @@ $(function() {
53 53
					for(var i = 0; i < data.data.length; i++) {
54 54
						var add = '<div class="addworkbtn-list addworkbtn-list2" ><div class="resoumag" data-title="">'
55 55
						add += '<div class="art_topicBox art_topicBox2"><div class="art_img" style=""></div>'
56
						add += '<div class="art_topicbox"><h6 id="artical_topic" >'+ data.data[i].articleTitle + '</h6></div>'
56
						add += '<div class="art_tbox"><h6 id="artical_topic" >'+ data.data[i].articleTitle + '</h6></div>'
57 57
						add += '</div><div class="tagsBox"><span></span></div>'
58 58
						add += '</div></div>';
59 59
						$add = $(add);

+ 221 - 0
js/scrollfix.js

@ -0,0 +1,221 @@
1
(function($) {
2
	//URI:http://caibaojian.com/scrollfix
3
	//author:caibaojian
4
	//website:http://caibaojian.com
5
	//descirption:scroll and fixed some div
6
	$.fn.scrollFix = function(options) {
7
		return this.each(function() {
8
9
			var opts = $.extend({}, $.fn.scrollFix.defaultOptions, options);
10
			var obj = $(this),
11
				base = this,
12
				selfTop = 0,
13
				selfLeft = 0,
14
				toTop = 0,
15
				parentOffsetLeft = 0,
16
				parentOffsetTop = 0,
17
				outerHeight,
18
				outerWidth,
19
				objWidth = 0,
20
				placeholder = jQuery('<div>'), //创建一个jquery对象
21
				optsTop = opts.distanceTop, //定义到顶部的高度
22
				endfix = 0; //开始停止固定的位置
23
24
			var originalPosition;
25
			var originalOffsetTop;
26
			var originalZIndex;
27
			var lastOffsetLeft = -1;
28
			var isUnfixed = true;
29
			//如果没有找到节点,不进行处理
30
			if (obj.length <= 0) {
31
				return;
32
			}
33
			if (lastOffsetLeft == -1) {
34
				originalZIndex = obj.css('z-index');
35
				position = obj.css('position');
36
				originalPosition = obj.css('position');
37
38
				originalOffsetTop = obj.css('top');
39
			}
40
41
			var zIndex = obj.css('zIndex');
42
			if (opts.zIndex != 0) {
43
				zIndex = opts.zIndex;
44
			}
45
			//获取相对定位或者绝对定位的父类
46
			var parents = obj.parent();
47
			var Position = parents.css('position');
48
			while (!/^relative|absolute$/i.test(Position)) { //检测浮动元素的父类元素定位为'relative'或者'absolute',是的话退出,否则的话,执行循环,继续寻找它的父类
49
				parents = parents.parent();
50
				Position = parents.css('position');
51
				if (/^body|html$/i.test(parents[0].tagName)) break; //假如父类元素的标签为body或者HTML,说明没有找到父类为以上的定位,退出循环
52
			}
53
54
			var ie6 = !-[1, ] && !window.XMLHttpRequest; //兼容IE6
55
			var resizeWindow = false;
56
57
			function resetScroll() {
58
				setUnfixed();
59
				selfTop = obj.offset().top; //对象距离顶部高度
60
				selfLeft = obj.offset().left; //对象距离左边宽度
61
				outerHeight = obj.outerHeight(); //对象高度
62
				outerHeight = parseFloat(outerHeight) + parseFloat(obj.css('marginBottom').replace(/auto/, 0));
63
				outerWidth = obj.outerWidth(); //对象外宽度
64
//				objWidth = obj.width();
65
				objWidth = obj.outerWidth(true);
66
				var documentHeight = $(document).height(); //文档高度
67
				var startTop = $(opts.startTop), //开始浮动固定对象
68
					startBottom = $(opts.startBottom),
69
					toBottom, //停止滚动位置距离底部的高度
70
					ScrollHeight; //对象滚动的高度
71
72
				//计算父类偏移值
73
				if (/^body|html$/i.test(parents[0].tagName)) { //当父类元素非body或者HTML时,说明找到了一个父类为'relative'或者'absolute'的元素,得出它的偏移高度
74
					parentOffsetTop = 0, parentOffsetLeft = 0;
75
				} else {
76
					parentOffsetLeft = parents.offset().left, parentOffsetTop = parents.offset().top;
77
				}
78
79
				// 计算父节点的上边到顶部距离
80
				// 如果 body 有 top 属性, 消除这些位移
81
				var bodyToTop = parseInt(jQuery('body').css('top'), 10);
82
				if (!isNaN(bodyToTop)) {
83
					optsTop += bodyToTop;
84
				}
85
				//计算停在底部的距离
86
				if (!isNaN(opts.endPos)) {
87
					toBottom = opts.endPos;
88
				} else {
89
					toBottom = parseFloat(documentHeight - $(opts.endPos).offset().top);
90
				}
91
				//计算需要滚动的高度以及停止滚动的高度
92
				ScrollHeight = parseFloat(documentHeight - toBottom - optsTop), endfix = parseFloat(ScrollHeight - outerHeight);
93
				//计算顶部的距离值
94
				if (startTop[0]) {
95
					var startTopOffset = startTop.offset(),
96
						startTopPos = startTopOffset.top;
97
					selfTop = startTopPos;
98
				}
99
				if (startBottom[0]) {
100
					var startBottomOffset = startBottom.offset(),
101
						startBottomPos = startBottomOffset.top,
102
						startBottomHeight = startBottom.outerHeight();
103
					selfTop = parseFloat(startBottomPos + startBottomHeight);
104
				}
105
106
				toTop = selfTop - optsTop;
107
				toTop = (toTop > 0) ? toTop : 0;
108
109
				var selfBottom = documentHeight - selfTop - outerHeight;
110
				//如果滚动停在底部的值不为0,并且自身到底部的高度小于上面这个值,不执行浮动固定
111
				if ((toBottom != 0) && (selfBottom <= toBottom)) {
112
					return;
113
				}
114
115
			}
116
			function setUnfixed() {
117
				if (!isUnfixed) {
118
					lastOffsetLeft = -1;
119
					placeholder.css("display", "none");
120
					obj.css({
121
						'z-index': originalZIndex,
122
						'width': '',
123
						'position': originalPosition,
124
						'left': '',
125
						'top': originalOffsetTop,
126
						'margin-left': ''
127
					});
128
					obj.removeClass('scrollfixed');
129
					isUnfixed = true;
130
				}
131
			}
132
133
			function onScroll() {
134
				lastOffsetLeft = 1;
135
				var ScrollTop = $(window).scrollTop();
136
				if (opts.bottom != -1) {
137
					ScrollTop = ScrollTop + $(window).height() - outerHeight - opts.bottom;
138
				}
139
				if (ScrollTop > toTop && (ScrollTop < endfix)) {
140
					if (ie6) { //IE6则使用这个样式
141
						obj.addClass(opts.baseClassName).css({
142
							"z-index": zIndex,
143
							"position": "absolute",
144
							"top": opts.bottom == -1 ? ScrollTop + optsTop - parentOffsetTop : ScrollTop - parentOffsetTop,
145
							"bottom": 'auto',
146
							"left": selfLeft - parentOffsetLeft,
147
							'width': objWidth
148
						})
149
					} else {
150
						obj.addClass(opts.baseClassName).css({
151
							"z-index": zIndex,
152
							"position": "fixed",
153
							"top": opts.bottom == -1 ? optsTop : '',
154
							"bottom": opts.bottom == -1 ? '' : opts.bottom,
155
							"left": selfLeft,
156
							"width": objWidth
157
						});
158
					}
159
					placeholder.css({
160
						'height': outerHeight,
161
						'width': outerWidth,
162
						'display': 'block'
163
					}).insertBefore(obj);
164
				} else if (ScrollTop >= endfix) {
165
					obj.addClass(opts.baseClassName).css({
166
						"z-index": zIndex,
167
						"position": "absolute",
168
						"top": endfix - parentOffsetTop + optsTop,
169
						'bottom': '',
170
						"left": selfLeft - parentOffsetLeft,
171
						"width": objWidth
172
					});
173
					placeholder.css({
174
						'height': outerHeight,
175
						'width': outerWidth,
176
						'display': 'block'
177
					}).insertBefore(obj)
178
				} else {
179
					obj.removeClass(opts.baseClassName).css({
180
						"z-index": originalZIndex,
181
						"position": "static",
182
						"top": "",
183
						"bottom": "",
184
						"left": ""
185
					});
186
					placeholder.remove()
187
				}
188
			}
189
			var Timer = 0;
190
			// if (isUnfixed) {
191
			resetScroll();
192
			// }
193
			$(window).on("scroll", function() {
194
				if (Timer) {
195
					clearTimeout(Timer);
196
				}
197
				Timer = setTimeout(onScroll, 0);
198
			});
199
			// 当发现调整屏幕大小时,重新执行代码
200
			$(window).on("resize", function() {
201
				if (Timer) {
202
					clearTimeout(Timer);
203
				}
204
				Timer = setTimeout(function() {
205
					isUnfixed = false;
206
					resetScroll();
207
					onScroll();
208
				}, 0);
209
			});
210
		})
211
	}
212
	$.fn.scrollFix.defaultOptions = {
213
		startTop: null, //滑到这个位置顶部时开始浮动,默认为空
214
		startBottom: null, //滑到这个位置末端开始浮动,默认为空
215
		distanceTop: 0, //固定在顶部的高度
216
		endPos: 0, //停靠在底部的位置,可以为jquery对象
217
		bottom: -1, //底部位置
218
		zIndex: 0, //z-index值
219
		baseClassName: 'scrollfixed' //开始固定时添加的类
220
	};
221
})(jQuery);

+ 1 - 1
js/workindex.js

@ -1081,7 +1081,7 @@ $(function(){
1081 1081
					for(var i = 0; i < data.data.length; i++) {
1082 1082
						var add = '<li><a href="articalInfo.html?articleId=' + data.data[i].articleId + '&professorId='+data.data[i].professorId+'">'
1083 1083
						add += '<div class="art_topicBox"><div class="art_img" style=""></div>'
1084
						add += '<div class="art_topicbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
1084
						add += '<div class="art_tbox"><h6 id="artical_topic" >' + data.data[i].articleTitle + '</h6></div>'
1085 1085
						add += '</div><div class="tagsBox"><span></span></div>'
1086 1086
						add += '</a></li>';
1087 1087
						$add = $(add);