实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
AخA
 
1
<!doctype html>
2
<html lang="en">
3
<head>
4
  <meta charset="utf-8">
5
  <title>jQuery UI 缩放(Resizable) - 限制缩放区域</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
  #container { width: 300px; height: 300px; }
12
  #container h3 { text-align: center; margin: 0; margin-bottom: 10px; }
13
  #resizable { background-position: top left; width: 150px; height: 150px; }
14
  #resizable, #container { padding: 0.5em; }
15
  </style>
16
  <script>
17
  $(function() {
18
    $( "#resizable" ).resizable({
19
      containment: "#container"
20
    });
21
  });
22
  </script>
23
</head>
24
<body>
25
 
26
<div id="container" class="ui-widget-content">
27
  <h3 class="ui-widget-header">限制</h3>
28
  <div id="resizable" class="ui-state-active">
29
    <h3 class="ui-widget-header">缩放(Resizable)</h3>
30
  </div>
31
</div>
32
 
33
 
34
</body>
35
</html>