Browse Source

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

luyanan 8 years ago
parent
commit
f119011595

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

@ -12,8 +12,13 @@ input{ outline:none;}
12 12
.theme h1{font-size:60px;line-height:80px; color:#fff; text-align:center; text-shadow:0px 0px 10px #2d2524;}
13 13
.theme h2{font-size:30px;line-height:50px; color:#fff; text-align:center; text-shadow:0px 0px 10px #2d2524;}
14 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 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 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,7 +48,8 @@ input{ outline:none;}
43 48
.field-icon6{ background:url(../images/field07.png) no-repeat center center;}
44 49
.field-icon7{ background:url(../images/field02.png) no-repeat center center;}
45 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 53
.hot-field .more{ color:#fff;}
48 54
/*热门专家*/
49 55
.hot-professor{ width:100%;  padding: 40px 0; }
@ -60,9 +66,9 @@ input{ outline:none;}
60 66
.content{ width:100%; height:auto; background:#f8f8f8; padding:60px 0 2px 0; }
61 67
.content-in{ width:1170px;/*min-height:300px;*/ margin:auto;padding-bottom:20px;}
62 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 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 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,7 +56,14 @@
56 56
			<h1>科袖</h1>
57 57
			<h2>搭建专家与企业之间的桥梁</h2>
58 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 67
				<input type="text" placeholder="搜索专家、研究方向或科研机构" class="sear-txt" id="searchContent" >
61 68
				<div class="sear-btn" id="search" >搜索</div>
62 69
			</div>
@ -131,10 +138,10 @@
131 138
			</div>
132 139
	
133 140
		</div>
134
		<a href="#" class="more">更多领域&gt;</a>
141
		<a href="search.html" class="more">更多领域<em></em></a>
135 142
	</div>
136 143
	<!--热门专家-->
137
	<div class="hot-professor">
144
	<!--<div class="hot-professor">
138 145
		<h4 class="hh4">热门专家</h4>
139 146
		<div class="professor-box">
140 147
			<div class="professor">
@ -268,8 +275,8 @@
268 275
			
269 276
			
270 277
		</div>
271
		<a href="#" class="more">更多专家&gt;</a>
272
	</div>
278
		<a href="search.html" class="more">更多专家</a>
279
	</div> -->
273 280
</div>
274 281
<div id="footer">
275 282
	<div class="footer-top">

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

@ -165,6 +165,15 @@ function titleLimitFontCountFn(){
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 179
function concultProInfo(professorId){

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

@ -76,17 +76,36 @@ $("#hsearchContent").blur(function() {
76 76
$("#searchContent").blur(function() {
77 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 85
$("#search").on("click", function() {
80 86
	var searchContent = $("#searchContent").val();
81
	var lookFor = $("#lookFor").val();
82
	console.log(lookFor);
83 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 100
$("#hsearch").on("click", function() {
86 101
	var searchContent = $("#hsearchContent").val();
87 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 110
$('.professor').hover(function() {
92 111
	$(this).find(".professor-data").stop(true, false).animate({

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

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

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

@ -51,7 +51,14 @@
51 51
	<div class="content">
52 52
        <div class="content-in">
53 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 62
                    <input type="text" placeholder="搜索专家、研究方向或科研机构" class="sear-txt" id="searchContent">
56 63
                    <div class="sear-btn" id="search1">搜索</div>
57 64
                </div>
@ -155,6 +162,5 @@
155 162
<script type="text/javascript" src="js/jquery.similar.msgbox.js"></script>
156 163
<script type="text/javascript" src="js/popup.js"></script>
157 164
<script type="text/javascript" src="js/search.js"></script>
158

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