li лет назад: 7
Родитель
Сommit
99b417aa43
2 измененных файлов с 6 добавлено и 7 удалено
  1. 5 6
      js/common.js
  2. 1 1
      js/head-staticize.js

+ 5 - 6
js/common.js

@ -53,15 +53,14 @@ $("#searchContent").keydown(function(e) {
53 53
$("#hsearchContent").keydown(function(e) {
54 54
	if(e.which == 13) {
55 55
		var searchContent = $("#hsearchContent").val();
56
		if($(this).siblings()[0].id=="searchh") {
57
			location.href = "/searchNew.html?searchContent=" + encodeURI(searchContent);
58
			return;
59
		}
56 60
		location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
57 61
	}
58 62
})
59
$("#hsearchContentb").keydown(function(e) {
60
	if(e.which == 13) {
61
		var searchContent = $("#hsearchContentb").val();
62
		location.href = "/searchNew.html?searchContent=" + encodeURI(searchContent);
63
	}
64
})
63

65 64
$("#hsearch").on("click", function() {
66 65
	var searchContent = $("#hsearchContent").val();
67 66
	setTimeout(function(){

+ 1 - 1
js/head-staticize.js

@ -13,7 +13,7 @@ var headerHtml = '';
13 13
						'</ul>' +
14 14
					'</div>' +
15 15
					'<div class="searchblock">'+
16
				    '<input type="text" placeholder="搜索专家、资源、文章" class="search-txt" id="hsearchContentb">'+
16
				    '<input type="text" placeholder="搜索专家、资源、文章" class="search-txt" id="hsearchContent">'+
17 17
						'<div class="search-btn" id="searchh"><span class="search-icon"></span></div>'+
18 18
					'</div>'+
19 19
					//未登录状态