
128
|
第九章
<input id=book />
<script>
// 要在建議清單內提議的項目陣列
var books = ["Web development with J2EE", "Practical CSS & JavaScript",
"Practical Ruby on Rails", "Introduction to HTML & CSS",
"jQuery UI"];
$("input#book").autocomplete ({
source : books,
minLength : 0
}).focus (function (event)
{
$(this).autocomplete ("search", "");
});
</script>
在建議選項清單出現的時候顯示特效
在預設情形下,jQuery UI 一產生建議清單就會立刻顯示出來。您可以讓它在顯示過程
加入視覺效果,比如說 slideDown 效果:
<script src = jquery.js></script>
<script src = jqueryui/js/jquery-ui-1.8.16.custom.min.js></script>
<link rel=stylesheet type=text/css
href=jqueryui/css/smoothness/jquery-ui-1.8.16.custom.css />
<h3>Enter the name of the book:</h3>
<input ...