Browse Source

专家信息浏览与修改的菜单导航定位

luyanan 8 years ago
parent
commit
b55038b348
3 changed files with 38 additions and 19 deletions
  1. 1 1
      css/index.css
  2. 20 6
      js/information.brow.js
  3. 17 12
      js/information.js

+ 1 - 1
css/index.css

@ -249,7 +249,7 @@ input[type='radio'].radio:checked + .radio {background:url(../images/redio.png)
249 249
.left-title{ width:165px; height:44px;font-size:20px;line-height:44px; border-bottom:1px #ffad55 solid; padding-left:10px; }
250 250
.subsidebar{ display:block; width:100%; height:26px; padding-left:18px;font-size:14px;line-height:26px;color:#313131; margin-top:5px;}
251 251
.subcolor{ background:#ff9900; color:#fff;}
252
.subsidebar:hover{ background:#ff9900; color:#fff;}
252

253 253

254 254
.content-right{ width:75%;min-height:100px; float:right; }
255 255
.right-box{ width:100%; background:#fff; border:1px #eaeaea solid; margin-bottom:10px; }

+ 20 - 6
js/information.brow.js

@ -693,19 +693,33 @@ $(function() {
693 693
	});
694 694
695 695
	
696
		
697
696
	
698 697
	//拿到点击的顺序,然后求出局文档的距离
698
	$(".subsidebar").mouseenter(function(){
699
		var dd=$(this)[0].className;
700
		if(dd!="subsidebar subcolor"){
701
			$(this).css("background","#efefef");
702
		}
703
	}).mouseleave(function(){
704
		$(this).css("background","")
705
	});
706
	//专家信息点击换背景颜色
699 707
	$(".subsidebar").click(function() {
700
		var index = $(this).index()-1;
701
		console.log(index)
702
		$(this).addClass("subcolor").siblings().removeClass("subcolor");
708
		$(".subsidebar").removeClass("subcolor");
709
		$(".subsidebar").eq($(".subsidebar").index(this)).addClass("subcolor");
710
	});
711
	$(".subsidebar").click(function() {
712
		var index = $(".subsidebar").index(this)+1;
713
        //console.log(index)
703 714
		var offset = $(".introduction").eq(index).offset();
704 715
		$("body,html").animate({
705 716
			scrollTop: offset.top - 80 + "px" //��body��scrollTop����pos��top����ʵ���˹��� 
706 717
		}, 1000);
707
718
	}).mousedown(function(){
719
	  	$(this).css("background","");
708 720
	});
721
	
722
	
709 723
	/*科研文章*/
710 724
	$.ajax({
711 725
		url: "/ajax/article/qaPro",

+ 17 - 12
js/information.js

@ -889,27 +889,32 @@ $(function() {
889 889
				"bottom": "-50px"
890 890
			});
891 891
		})
892
		//专家信息点击换背景颜色
892
	
893
	//拿到点击的顺序,然后求出局文档的距离
894
	$(".subsidebar").mouseenter(function(){
895
		var dd=$(this)[0].className;
896
		if(dd!="subsidebar subcolor"){
897
			$(this).css("background","#efefef");
898
		}
899
	}).mouseleave(function(){
900
		$(this).css("background","")
901
	});
902
	//专家信息点击换背景颜色
893 903
	$(".subsidebar").click(function() {
894 904
		$(".subsidebar").removeClass("subcolor");
895 905
		$(".subsidebar").eq($(".subsidebar").index(this)).addClass("subcolor");
896 906
	});
897
	//拿到点击的顺序,然后求出局文档的距离
898 907
	$(".subsidebar").click(function() {
899
		var index = $(".subsidebar").index(this);
908
		var index = $(".subsidebar").index(this)+1;
909
        //console.log(index)
900 910
		var offset = $(".introduction").eq(index).offset();
901

902 911
		$("body,html").animate({
903
			scrollTop: offset.top - 80 //��body��scrollTop����pos��top����ʵ���˹��� 
912
			scrollTop: offset.top - 80 + "px" //��body��scrollTop����pos��top����ʵ���˹��� 
904 913
		}, 1000);
905

914
	}).mousedown(function(){
915
	  	$(this).css("background","");
906 916
	});
907
	//放在编辑上面添加一个class和减少一个class
908
	//$("#container .edit").hover(function(){
909
	//	$(this).addClass("edit-position-left")	
910
	//	},function(){
911
	//	$(this).removeClass("edit-position-left")			
912
	//		});
917

913 918
	//获取点击那个编辑,及
914 919
	$("#container .edit").click(function() {
915 920
		var edit = $(".edit").index(this);