Jquery 自动完成建议 - 小字体列表 [英] Jquery autocomplete suggestions - small font list
本文介绍了Jquery 自动完成建议 - 小字体列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Jquery 自动完成建议列表字体非常大,我想要像在文本框中输入字体一样小.如何限制建议列表中的小字体?请查看以下屏幕和代码:
Jquery Autocomplete suggestions list font is very bigger ,I want to be small like typing in text box font need. how to restrict with small fonts in suggestions list ? Please see the below screen and code:
<!DOCTYPE>
<html>
<head>
<title>Auto Complete in JSP Java</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<STYLE TYPE="text/css" media="all">
.ui-autocomplete {
position: absolute;
cursor: default;
height: 200px;
overflow-y: scroll;
overflow-x: hidden;}
</STYLE>
<script>
$(function() {
$("#names").autocomplete({
source: function(request, response) {
$.ajax({
url: "searchName.jsp",
type: "POST",
dataType: "json",
data: { name: request.term},
success: function( data, textStatus, jqXHR) {
var items = data;
response(items);
},
error: function (error) {
alert('error: ' + error);
}
});
},
minLength: 3
});
});
</script>
</head>
<body>
<input type="text" name="name" id="names" />
</body>
</html>
推荐答案
定义在:
.ui-widget {
font-family: Verdana,Arial,sans-serif;
font-size: 10px;
}
但是你可以在它前面加上一些东西,例如
But you may precede it something e.g.
.ui-autocomplete.ui-widget {
font-family: Verdana,Arial,sans-serif;
font-size: 10px;
}
这篇关于Jquery 自动完成建议 - 小字体列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文