| 1 | <!doctype html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | <title>jQuery UI Resizable - Constrain resize area</title> |
| 7 | <link rel="stylesheet" href="../../themes/base/all.css"> |
| 8 | <link rel="stylesheet" href="../demos.css"> |
| 9 | <style> |
| 10 | #container { width: 300px; height: 300px; } |
| 11 | #container h3 { text-align: center; margin: 0; margin-bottom: 10px; } |
| 12 | #resizable { background-position: top left; width: 150px; height: 150px; } |
| 13 | #resizable, #container { padding: 0.5em; } |
| 14 | </style> |
| 15 | <script src="../../external/requirejs/require.js"></script> |
| 16 | <script src="../bootstrap.js"> |
| 17 | $( "#resizable" ).resizable({ |
| 18 | containment: "#container" |
| 19 | }); |
| 20 | </script> |
| 21 | </head> |
| 22 | <body> |
| 23 | |
| 24 | <div id="container" class="ui-widget-content"> |
| 25 | <h3 class="ui-widget-header">Containment</h3> |
| 26 | <div id="resizable" class="ui-state-active"> |
| 27 | <h3 class="ui-widget-header">Resizable</h3> |
| 28 | </div> |
| 29 | </div> |
| 30 | |
| 31 | <div class="demo-description"> |
| 32 | <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> |
| 33 | </div> |
| 34 | </body> |
| 35 | </html> |