4
<title>jQuery UI Resizable - Constrain resize area</title>
5
<link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
6
<script type="text/javascript" src="../../jquery-1.3.2.js"></script>
7
<script type="text/javascript" src="../../ui/ui.core.js"></script>
8
<script type="text/javascript" src="../../ui/ui.resizable.js"></script>
9
<link type="text/css" href="../demos.css" rel="stylesheet" />
10
<style type="text/css">
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; }
16
<script type="text/javascript">
18
$("#resizable").resizable({
19
containment: '#container'
27
<div id="container" class="ui-widget-content">
28
<h3 class="ui-widget-header">Containment</h3>
29
<div id="resizable" class="ui-state-active">
30
<h3 class="ui-widget-header">Resizable</h3>
34
</div><!-- End demo -->
36
<div class="demo-description">
38
<p>Define the boundaries of the resizable area. Use the <code>containment</code> option to specify a parent DOM element or a jQuery selector, like 'document.'</p>
40
</div><!-- End demo-description -->