案例:jQuery UI案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!doctype html>
2
<html>
3
<head>
4
  <meta charset="utf-8">
5
  <title>jQuery UI 旋转器(Spinner) - 小数</title>
6
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
7
  <script src="//code.jquery.com/jquery-1.9.1.js"></script>
8
  <script src="/static/js/jqueryui/resources/demos/external/jquery.mousewheel.js"></script>
9
  <script src="/static/js/jqueryui/resources/demos/external/globalize.js"></script>
10
  <script src="/static/js/jqueryui/resources/demos/external/globalize.culture.de-DE.js"></script>
11
  <script src="/static/js/jqueryui/resources/demos/external/globalize.culture.ja-JP.js"></script>
12
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
13
  <link rel="stylesheet" href="https://jqueryui.com/resources/demos/style.css">
14
  <script>
15
  $(function() {
16
    $( "#spinner" ).spinner({
17
      step: 0.01,
18
      numberFormat: "n"
19
    });
20
 
21
    $( "#culture" ).change(function() {
22
      var current = $( "#spinner" ).spinner( "value" );
23
      Globalize.culture( $(this).val() );
24
      $( "#spinner" ).spinner( "value", current );
25
    });
26
  });
27
  </script>
28
</head>
29
<body>
30
 
31
<p>
32
  <label for="spinner">小数旋转器:</label>
33
  <input id="spinner" name="spinner" value="5.06">
34
</p>
35
<p>
36
  <label for="culture">选择一种用于格式化的文化:</label>
37
  <select id="culture">
38
    <option value="en-EN" selected="selected">English</option>
39
    <option value="de-DE">German</option>
40
    <option value="ja-JP">Japanese</option>
41
  </select>
42
</p>
43
</body>
44
</html>
45