案例:jQuery UI案例     状态:可编辑再运行    进入竖版
 运行结果 
AخA
 
1
<!doctype html>
2
<html lang="en">
3
<head>
4
  <meta charset="utf-8">
5
  <title>jQuery UI 选择(Selectable) - 序列化</title>
6
  <link rel="stylesheet" href="/css/jqu1.10.4/jquery-ui.min.css">
7
  <script src="/js/jqu/jquery.min1.10.2.js"></script>
8
  <script src="/js/jqu/jquery-ui.min1.10.4.js"></script>
9
  <link rel="stylesheet" href="jqueryui/style.css">
10
 
11
  <style>
12
  #feedback { font-size: 1.4em; }
13
  #selectable .ui-selecting { background: #FECA40; }
14
  #selectable .ui-selected { background: #F39814; color: white; }
15
  #selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
16
  #selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
17
  </style>
18
  <script>
19
  $(function() {
20
    $( "#selectable" ).selectable({
21
      stop: function() {
22
        var result = $( "#select-result" ).empty();
23
        $( ".ui-selected", this ).each(function() {
24
          var index = $( "#selectable li" ).index( this );
25
          result.append( " #" + ( index + 1 ) );
26
        });
27
      }
28
    });
29
  });
30
  </script>
31
</head>
32
<body>
33
 
34
<p id="feedback">
35
<span>您已经选择了:</span> <span id="select-result"></span>
36
</p>
37
 
38
<ol id="selectable">
39
  <li class="ui-widget-content">Item 1</li>
40
  <li class="ui-widget-content">Item 2</li>
41
  <li class="ui-widget-content">Item 3</li>
42
  <li class="ui-widget-content">Item 4</li>
43
  <li class="ui-widget-content">Item 5</li>
44
  <li class="ui-widget-content">Item 6</li>
45
</ol>
46
 
47
 
48
</body>