Debian Codegraph @

demos/resizable/aspect-ratio.html

raw
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 - Preserve aspect ratio</title>
7 <link rel="stylesheet" href="../../themes/base/all.css">
8 <link rel="stylesheet" href="../demos.css">
9 <style>
10 #resizable { width: 160px; height: 90px; padding: 0.5em; }
11 #resizable h3 { text-align: center; margin: 0; }
12 </style>
13 <script src="../../external/requirejs/require.js"></script>
14 <script src="../bootstrap.js">
15 $( "#resizable" ).resizable({
16 aspectRatio: 16 / 9
17 });
18 </script>
19 </head>
20 <body>
21
22 <div id="resizable" class="ui-widget-content">
23 <h3 class="ui-widget-header">Preserve aspect ratio</h3>
24 </div>
25
26 <div class="demo-description">
27 <p>Maintain the existing aspect ratio or set a new one to constrain the proportions on resize. Set the <code>aspectRatio</code> option to true, and optionally pass in a new ratio (i.e., 4/3)</p>
28 </div>
29 </body>
30 </html>