jack лет назад: 8
Родитель
Сommit
b382abe2d2
1 измененных файлов с 66 добавлено и 58 удалено
  1. 66 58
      js/information.brow.js

+ 66 - 58
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
		});
@ -711,9 +718,9 @@ $(function() {
711 718
	$(".subsidebar").click(function() {
712 719
		var index = $(".subsidebar").index(this)+1;
713 720
        //console.log(index)
714
		var offset = $(".introduction").eq(index).offset();
715
		$("body,html").animate({
716
			scrollTop: offset.top - 80 + "px" //��body��scrollTop����pos��top����ʵ���˹��� 
721
		var offset = $(".introduction").eq(index).offset();
722
		$("body,html").animate({
723
			scrollTop: offset.top - 80 + "px" //��body��scrollTop����pos��top����ʵ���˹��� 
717 724
		}, 1000);
718 725
	}).mousedown(function(){
719 726
	  	$(this).css("background","");
@ -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
})