#resizable { background-position: top left; width: 150px; height: 150px; }
#resizable, #container { padding: 0.5em; }
</style>
<scripttype="text/javascript">
$(function() {
$("#resizable").resizable({
containment: '#container'
});
});
</script>
</head>
<body>
<divclass="demo">
<divid="container"class="ui-widget-content">
<h3class="ui-widget-header">Containment</h3>
<divid="resizable"class="ui-state-active">
<h3class="ui-widget-header">Resizable</h3>
</div>
</div>
</div><!-- End demo -->
<divclass="demo-description">
<p>Define the boundaries of the resizable area. Use the <strong>containment</strong> option to specify a parent DOM element or a jQuery selector, like 'document.'</p>