simple-resize.mustache revision 35d039da10970deb9abb779286f19907ec86350c
1029N/A<div class="intro">
1029N/A<p>This example shows the simple use case where we make an HTML element resizable.</p>
1356N/A</div>
1029N/A
1552N/A<div class="example">
1029N/A {{>simple-resize-source}}
1029N/A</div>
1123N/A
1123N/A<h3>Setting up the Node</h3>
1123N/A<p>First we need to create an HTML element to make resizable.</p>
1123N/A
1123N/A```
1123N/A{{>simple-resize-source-html}}
1123N/A```
1123N/A
1123N/A<p>Next, we give that element some CSS to make it visible.</p>
1123N/A
1123N/A```
1123N/A{{>simple-resize-source-css}}
1123N/A```
1123N/A
1123N/A<h3>Setting up the YUI Instance</h3>
1123N/A<p>We need to create our YUI instance and tell it to load the <code>resize</code> module; for this simple use case, we could also use the <code>base-resize</code> submodule.</p>
1123N/A
1029N/A```
1029N/AYUI().use('resize');
1029N/A```
1029N/A
1029N/A<h3>Making the Node Resizable</h3>
1029N/A
1552N/A<p>Now that we have a YUI instance with the <code>resize</code> module, we need to instantiate the <code>Resize</code> instance on this Node.</p>
1029N/A
1029N/A```
1552N/A{{>simple-resize-source-js}}
1552N/A```
1552N/A
1029N/A<p>Upon instantiation, the element's drag handles will appear and the element is resizable via drag-and-drop.</p>
1029N/A
1029N/A