上次介绍了 Bootstrap 2 中附带的 typeahead,功能强大,但是使用起来不太方便,作者 Terry Rosen 已经升级了一个新版本 v1.2.2,作出了很大的改进。
下载地址
https://github.com/tcrosen/twitter-bootstrap-typeahead
使用环境
- Twitter Bootstrap 2.0+
- jQuery 1.7+
页面准备
<script src=”/path/to/jquery.js” type=”text/javascript”></script>
<script src=”/path/to/bootstrap-typeahead.js” type=”text/javascript”></script>
脚本
事件
事件说明grepperFilters relevant results from the source.highlighterHighlights any matching results in