实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
AخA
 
1
<!doctype html>
2
<html lang="en">
3
<head>
4
  <meta charset="utf-8">
5
  <title>jQuery UI 自动完成(Autocomplete) - 可滚动的结果</title>
6
  <link rel="stylesheet" href="//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css">
7
  <script src="//apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
8
  <script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
9
  <link rel="stylesheet" href="jqueryui/style.css">
10
  <style>
11
  .ui-autocomplete {
12
    max-height: 100px;
13
    overflow-y: auto;
14
    /* 防止水平滚动条 */
15
    overflow-x: hidden;
16
  }
17
  /* IE 6 不支持 max-height
18
   * 我们使用 height 代替,但是这会强制菜单总是显示为那个高度
19
   */
20
  * html .ui-autocomplete {
21
    height: 100px;
22
  }