实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
AخA
 
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="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
10
  <link rel="stylesheet" href="https://jqueryui.com/resources/demos/style.css">
11
  <script>
12
  $(function() {
13
    $( "#spinner" ).spinner({
14
      spin: function( event, ui ) {
15
        if ( ui.value > 10 ) {
16
          $( this ).spinner( "value", -10 );
17
          return false;
18
        } else if ( ui.value < -10 ) {
19
          $( this ).spinner( "value", 10 );
20
          return false;
21
        }
22
      }
23
    });
24
  });
25
  </script>
26
</head>
27
<body>
28
 
29
<p>
30
  <label for="spinner">选择一个值:</label>
31
  <input id="spinner" name="value">
32
</p>
33
</body>
34
</html>
35