Explorar el Código

1、首页搜素加上enter键进入搜素页面,热门领域在搜素页面选中相应的学术领域
2、修改了热门专家更多样式及链接,首页搜索页的下拉菜单浏览器不同样式

luyanan %!s(int64=8) %!d(string=hace) años
padre
commit
f119011595

+ 10 - 4
src/main/webapp/css/index.css

12
.theme h1{font-size:60px;line-height:80px; color:#fff; text-align:center; text-shadow:0px 0px 10px #2d2524;}
12
.theme h1{font-size:60px;line-height:80px; color:#fff; text-align:center; text-shadow:0px 0px 10px #2d2524;}
13
.theme h2{font-size:30px;line-height:50px; color:#fff; text-align:center; text-shadow:0px 0px 10px #2d2524;}
13
.theme h2{font-size:30px;line-height:50px; color:#fff; text-align:center; text-shadow:0px 0px 10px #2d2524;}
14
.main-search{ width:700px; height:46px; margin:auto; margin-top:20px; position:relative}
14
.main-search{ width:700px; height:46px; margin:auto; margin-top:20px; position:relative}
15
.main-search .lookwho{outline:none;position:absolute; height:40px; width:100px;border:none; border-right:1px solid #d6d6d6;border-radius:10px 0 0 10px; background:url(../images/downselect.png) no-repeat 70px center #fff; padding-left:16px; font-size:14px;line-height:38px; color:#888;}
15
.main-search .lookwho{outline:none;position:absolute; height:40px; width:100px;border:none; box-shadow: 0px 0px 3px #ccc inset;border-radius:10px 0 0 10px; background:url(../images/downselect.png) no-repeat 70px center #fff; padding-left:16px; font-size:14px;line-height:38px; color:#888;}
16

16

17
.simuselect{position:relative;}
18
.ulbox{ width:100px; height:40px; border:#060 1px solid;cursor:pointer; position:relative;} 
19
.lishow{background:#fff;overflow: hidden; border-radius:6px;position:absolute; top:40px; width:100px;box-shadow: 0px 0px 3px #ccc inset; z-index: 20;display:none;} 
20
.lishow li{ line-height:30px; list-style:none; padding:2px 16px; margin-top:1px;cursor: pointer;} 
21
.lishow li:hover{ background:#f0f0f0;} 
17

22

18
.sear-txt{ width:530px; height:40px; background:#fff; border:none; border-radius:10px 0 0 10px; float:left;font-size:16px;line-height:40px; padding-left:120px; color:#a3a3a3;}
23
.sear-txt{ width:530px; height:40px; background:#fff; border:none; border-radius:10px 0 0 10px; float:left;font-size:16px;line-height:40px; padding-left:120px; color:#a3a3a3;}
19
.sear-btn{ width:140px; height:40px; background:#ff8400; border-radius:0 10px 10px 0; float:left; cursor:pointer;font-size:18px;line-height:40px;; color:#fff; text-align:center; }
24
.sear-btn{ width:140px; height:40px; background:#ff8400; border-radius:0 10px 10px 0; float:left; cursor:pointer;font-size:18px;line-height:40px;; color:#fff; text-align:center; }
43
.field-icon6{ background:url(../images/field07.png) no-repeat center center;}
48
.field-icon6{ background:url(../images/field07.png) no-repeat center center;}
44
.field-icon7{ background:url(../images/field02.png) no-repeat center center;}
49
.field-icon7{ background:url(../images/field02.png) no-repeat center center;}
45
.field-icon8{ background:url(../images/field05.png) no-repeat center center;}
50
.field-icon8{ background:url(../images/field05.png) no-repeat center center;}
46
.more{ display:block; width:132px; height:35px; margin:auto; border:1px #fff solid; border-radius:10px;font-size:14px;line-height:35px;  text-align:center; color:#fff;}
51
.more{position: relative; display:block; width:132px; height:35px; margin:auto; border:1px #fff solid; border-radius:10px;font-size:14px;line-height:35px;padding:0 30px; color:#fff;}
52
.more em{ position: absolute; top: 50%;margin-top: -6px; margin-left: 4px;width: 14px; height: 14px; background:url(../images/more-white.png) center center no-repeat;background-size:100% 100%;}
47
.hot-field .more{ color:#fff;}
53
.hot-field .more{ color:#fff;}
48
/*热门专家*/
54
/*热门专家*/
49
.hot-professor{ width:100%;  padding: 40px 0; }
55
.hot-professor{ width:100%;  padding: 40px 0; }
60
.content{ width:100%; height:auto; background:#f8f8f8; padding:60px 0 2px 0; }
66
.content{ width:100%; height:auto; background:#f8f8f8; padding:60px 0 2px 0; }
61
.content-in{ width:1170px;/*min-height:300px;*/ margin:auto;padding-bottom:20px;}
67
.content-in{ width:1170px;/*min-height:300px;*/ margin:auto;padding-bottom:20px;}
62
.sear-search{ width:100%; height:56px;margin-top:20px;}
68
.sear-search{ width:100%; height:56px;margin-top:20px;}
63
.sear-search .lookwho{ height:40px; width:100px; border:1px solid #d6d6d6;border-radius:10px 0 0 10px; background:url(../images/downselect.png) no-repeat 70px center #fff; padding-left:16px; font-size:14px;line-height:38px; color:#888;}
69
.sear-search .lookwho{ height:40px; width:100px; border:none;box-shadow: 0px 0px 3px #ccc inset;border-radius:10px 0 0 10px; background:url(../images/downselect.png) no-repeat 70px center #fff; padding-left:16px; font-size:14px;line-height:38px; color:#888;}
64
.sear-search .lookwho:focus{ border:none;}
70
.sear-search .lookwho:focus{ border:none;}
65
.sear-search .sear-txt{ width:530px; height:40px; background:#fff; border:none; border-radius:0; float:left;font-size:16px;line-height:40px;box-shadow: 0px 0px 5px #ccc inset; padding-left:20px; color:#a3a3a3;}
71
.sear-search .sear-txt{ width:530px; height:40px; background:#fff; border:none; border-radius:0; float:left;font-size:16px;line-height:40px;box-shadow: 0px 0px 3px #ccc inset; padding-left:20px; color:#a3a3a3;}
66
.sear-search .sear-btn{ width:140px; height:40px; background:#ff8400; border-radius:0 10px 10px 0; float:left; cursor:pointer;font-size:18px;line-height:40px; color:#fff; text-align:center; }
72
.sear-search .sear-btn{ width:140px; height:40px; background:#ff8400; border-radius:0 10px 10px 0; float:left; cursor:pointer;font-size:18px;line-height:40px; color:#fff; text-align:center; }
67

73

68
/*搜索分类*/
74
/*搜索分类*/

BIN
src/main/webapp/images/more-white.png


+ 12 - 5
src/main/webapp/index.html

56
			<h1>科袖</h1>
56
			<h1>科袖</h1>
57
			<h2>搭建专家与企业之间的桥梁</h2>
57
			<h2>搭建专家与企业之间的桥梁</h2>
58
			<div class="main-search">
58
			<div class="main-search">
59
			    <select class="lookwho floatL" id="lookFor"><option value="0">找专家</option><option value="1">找资源</option></select>
59
				 <div class="simuselect floatL" id="lookFor">
60
                	<div class="ulbox lookwho" onclick="showmenu()" id="div_select">找专家</div> 
61
					<ul id="li_show" class="lishow"> 
62
					    <li><div onclick="selectThis('找专家')">找专家</div></li> 
63
					    <li><div onclick="selectThis('找资源')">找资源</div></li> 
64
					</ul>
65
				</div>
66
			    <!-- <select class="lookwho floatL" id="lookFor"><option value="0">找专家</option><option value="1">找资源</option></select>  -->
60
				<input type="text" placeholder="搜索专家、研究方向或科研机构" class="sear-txt" id="searchContent" >
67
				<input type="text" placeholder="搜索专家、研究方向或科研机构" class="sear-txt" id="searchContent" >
61
				<div class="sear-btn" id="search" >搜索</div>
68
				<div class="sear-btn" id="search" >搜索</div>
62
			</div>
69
			</div>
131
			</div>
138
			</div>
132
	
139
	
133
		</div>
140
		</div>
134
		<a href="#" class="more">更多领域&gt;</a>
141
		<a href="search.html" class="more">更多领域<em></em></a>
135
	</div>
142
	</div>
136
	<!--热门专家-->
143
	<!--热门专家-->
137
	<div class="hot-professor">
144
	<!--<div class="hot-professor">
138
		<h4 class="hh4">热门专家</h4>
145
		<h4 class="hh4">热门专家</h4>
139
		<div class="professor-box">
146
		<div class="professor-box">
140
			<div class="professor">
147
			<div class="professor">
268
			
275
			
269
			
276
			
270
		</div>
277
		</div>
271
		<a href="#" class="more">更多专家&gt;</a>
278
		<a href="search.html" class="more">更多专家</a>
272
	</div>
279
	</div> -->
273
</div>
280
</div>
274
<div id="footer">
281
<div id="footer">
275
	<div class="footer-top">
282
	<div class="footer-top">

+ 9 - 0
src/main/webapp/js/common.js

165
	} 
165
	} 
166
	
166
	
167
};
167
};
168
//模拟下拉菜单
169
function selectThis(value){ 
170
	$("#div_select").text(value); 
171
	$("#li_show").css("display","none"); 
172
} 
173

174
function showmenu(){ 
175
  $("#li_show").css("display","block");  
176
} 
168

177

169
//咨询 专家信息接口函数
178
//咨询 专家信息接口函数
170
function concultProInfo(professorId){
179
function concultProInfo(professorId){

+ 21 - 2
src/main/webapp/js/index.js

76
$("#searchContent").blur(function() {
76
$("#searchContent").blur(function() {
77
	synContent(2);
77
	synContent(2);
78
});
78
});
79

80

81
var lookFor = $("#lookFor ul li").index();
82
$("#lookFor ul li").on("click",function(){
83
	lookFor=$(this).index();
84
});
79
$("#search").on("click", function() {
85
$("#search").on("click", function() {
80
	var searchContent = $("#searchContent").val();
86
	var searchContent = $("#searchContent").val();
81
	var lookFor = $("#lookFor").val();
82
	console.log(lookFor);
83
	location.href = "search.html?searchContent=" + encodeURI(searchContent)+"&lookFor=" + lookFor;
87
	location.href = "search.html?searchContent=" + encodeURI(searchContent)+"&lookFor=" + lookFor;
84
});
88
});
89

90
//enter绑定时间
91
$("input").keydown(function(e){
92
	if(e.which==13) {
93
		synContent(1);
94
		synContent(2);
95
		var searchContent = $("#searchContent").val();
96
		location.href = "search.html?searchContent=" + encodeURI(searchContent)+"&lookFor=" + lookFor;
97
	}
98
	
99
})
85
$("#hsearch").on("click", function() {
100
$("#hsearch").on("click", function() {
86
	var searchContent = $("#hsearchContent").val();
101
	var searchContent = $("#hsearchContent").val();
87
	location.href = "search.html?searchContent=" + encodeURI(searchContent);
102
	location.href = "search.html?searchContent=" + encodeURI(searchContent);
88
});
103
});
89

104

105
//热门领域
106
$(".field").bind("click",function(){
107
	location.href = "search.html?subject=" + encodeURI($(this).text());
108
})
90
//热门专家
109
//热门专家
91
$('.professor').hover(function() {
110
$('.professor').hover(function() {
92
	$(this).find(".professor-data").stop(true, false).animate({
111
	$(this).find(".professor-data").stop(true, false).animate({

+ 17 - 6
src/main/webapp/js/search.js

4
	       var c=0;	
4
	       var c=0;	
5
	    }else{
5
	    }else{
6
	       var c=1;	
6
	       var c=1;	
7
	       $(".lookwho option[value='1']").attr("selected","selected");
7
//	       $(".lookwho option[value='1']").attr("selected","selected");
8
	       $("#div_select").text("找资源");
8
	    }
9
	    }
9
		var userid = $.cookie("userid");
10
		var userid = $.cookie("userid");
10
		var  subject;
11
		var  subject;
12
		var subb=$.trim(GetQueryString("subject"));
11
		var industry;
13
		var industry;
12
		var pageSize;
14
		var pageSize;
13
		var sub="SUBJECT";
15
		var sub="SUBJECT";
220
    				$("#subject").find(".sub").remove();
222
    				$("#subject").find(".sub").remove();
221
    				for(var i = 0 ; i < data.data.length; i++){
223
    				for(var i = 0 ; i < data.data.length; i++){
222
    					$("#subject").append("<a href='#' class='sub'title='"+data.data[i].caption+"'>"+data.data[i].caption+"</a>");	
224
    					$("#subject").append("<a href='#' class='sub'title='"+data.data[i].caption+"'>"+data.data[i].caption+"</a>");	
225
                         if(subb) {
226
    						if(subb==data.data[i].caption) {
227
    							$('.sub').eq(i).addClass('colorbg').siblings().removeClass("colorbg");
228
    						}
229
    					}
223
    					if(i>20)
230
    					if(i>20)
224
    						break;
231
    						break;
225
    				}
232
    				}
229
    		})
236
    		})
230
 		}
237
 		}
231
 		var Address = function (){
238
 		var Address = function (){
232
 			$.get("../ajax/dataDict/PRO_ADDRESS",function(data){ 			
239
 			$.get("../ajax/dataDict/ADDRESS",function(data){ 			
233
    			if(data.success){  
240
    			if(data.success){  
234
    				if(data.data.length <=10) {
241
    				if(data.data.length <=10) {
235
    					$(".andmore").eq(2).hide();
242
    					$(".andmore").eq(2).hide();
262
    		})
269
    		})
263
 		}		
270
 		}		
264
		var findProfessor = function (){			
271
		var findProfessor = function (){			
265
			subject = $("#subject .colorbg")[0].title;
272
			if(subb){
273
				subject=subb;
274
			}else{
275
				subject = $("#subject .colorbg")[0].title;
276
			}
266
			industry = $("#industry .colorbg")[0].title;
277
			industry = $("#industry .colorbg")[0].title;
267
			pageSize = 4;
278
			pageSize = 4;
268
			getData(key,subject,industry,pageSize,1,true,address);
279
			getData(key,subject,industry,pageSize,1,true,address);
357
//	})
368
//	})
358
	
369
	
359
	 //判断是搜寻专家还是资源
370
	 //判断是搜寻专家还是资源
360
	 $(".floatL").change(function(){
371
	 $(".lishow li").on("click",function(){
361
			c=$(".floatL option:selected").val();
372
			c=$(this).index();
373
			
362
			$("#industry").find(".no2").addClass("colorbg").siblings().removeClass("colorbg");
374
			$("#industry").find(".no2").addClass("colorbg").siblings().removeClass("colorbg");
363
			$("#subject").find(".nox").addClass("colorbg").siblings().removeClass("colorbg");
375
			$("#subject").find(".nox").addClass("colorbg").siblings().removeClass("colorbg");
364
			key=$("#searchContent").val();
376
			key=$("#searchContent").val();
368
		if(c==0){
380
		if(c==0){
369
			sub="SUBJECT";
381
			sub="SUBJECT";
370
			indu="INDUSTRY";
382
			indu="INDUSTRY";
371
			
372
		}
383
		}
373
		else{			
384
		else{			
374
			sub="SUBJECT";
385
			sub="SUBJECT";

+ 8 - 2
src/main/webapp/search.html

51
	<div class="content">
51
	<div class="content">
52
        <div class="content-in">
52
        <div class="content-in">
53
                <div class="sear-search">
53
                <div class="sear-search">
54
                	<select class="lookwho floatL"><option value="0">找专家</option><option value="1">找资源</option></select>
54
                	<div class="simuselect floatL">
55
	                	<div class="ulbox lookwho" onclick="showmenu()" id="div_select">找专家</div> 
56
						<ul id="li_show" class="lishow"> 
57
						    <li><div onclick="selectThis('找专家')">找专家</div></li> 
58
						    <li><div onclick="selectThis('找资源')">找资源</div></li> 
59
						</ul>
60
					</div>
61
                	<!-- <select class="lookwho floatL"><option value="0">找专家</option><option value="1">找资源</option></select> -->
55
                    <input type="text" placeholder="搜索专家、研究方向或科研机构" class="sear-txt" id="searchContent">
62
                    <input type="text" placeholder="搜索专家、研究方向或科研机构" class="sear-txt" id="searchContent">
56
                    <div class="sear-btn" id="search1">搜索</div>
63
                    <div class="sear-btn" id="search1">搜索</div>
57
                </div>
64
                </div>
155
<script type="text/javascript" src="js/jquery.similar.msgbox.js"></script>
162
<script type="text/javascript" src="js/jquery.similar.msgbox.js"></script>
156
<script type="text/javascript" src="js/popup.js"></script>
163
<script type="text/javascript" src="js/popup.js"></script>
157
<script type="text/javascript" src="js/search.js"></script>
164
<script type="text/javascript" src="js/search.js"></script>
158

159
</body>
165
</body>
160
</html>
166
</html>