JavaScript DHTML/Ext JS/Resizable

Материал из Web эксперт
Перейти к: навигация, поиск

Animated Transitions resizable area

   <source lang="html4strict">
 


<html> <head> <title>Hello World Window</title> <link rel="stylesheet" type="text/css" href="ext-3.0.0/resources/css/ext-all.css" /> <script type="text/javascript" src="ext-3.0.0/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext-3.0.0/ext-all.js"></script> <script language="javascript" > /*!

* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.ru
* http://www.extjs.ru/license
*/

var ResizableExample = {

   init : function(){
       
       var basic = new Ext.Resizable("basic", {
               width: 200,
               height: 100,
               minWidth:100,
               minHeight:50
       });
       
       var animated = new Ext.Resizable("animated", {
               width: 200,
               pinned: true,
               height: 100,
               minWidth:100,
               minHeight:50,
               animate:true,
               easing: "backIn",
               duration:.6
       });
       
       var wrapped = new Ext.Resizable("wrapped", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true
       });
       
       var transparent = new Ext.Resizable("transparent", {
           wrap:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           transparent:true
       });
       
       var custom = new Ext.Resizable("custom", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           handles: "all",
           draggable:true,
           dynamic:true
       });
       var customEl = custom.getEl();
       // move to the body to prevent overlap on my blog
       document.body.insertBefore(customEl.dom, document.body.firstChild);
       
       customEl.on("dblclick", function(){
           customEl.hide(true);
       });
       customEl.hide();
       
       Ext.get("showMe").on("click", function(){
           customEl.center();
           customEl.show(true);
       });
       
       var dwrapped = new Ext.Resizable("dwrapped", {
           wrap:true,
           pinned:true,
           width:450,
           height:150,
           minWidth:200,
           minHeight: 50,
           dynamic: true
       });
       
       var snap = new Ext.Resizable("snap", {
           pinned:true,
           width:250,
           height:100,
           handles: "e",
           widthIncrement:50,
           minWidth: 50,
           dynamic: true
       });
   }

}; Ext.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true); </script> <style type="text/css">

  1. basic, #animated {
   border:1px solid #c3daf9;
   color:#1e4e8f;
   font:bold 14px tahoma,verdana,helvetica;
   text-align:center;
   padding-top:20px;

}

  1. snap {
   border:1px solid #c3daf9;
   overflow:hidden;

}

  1. custom {
   cursor:move;

}

  1. custom-rzwrap{
   z-index: 100;

}

  1. custom-rzwrap .x-resizable-handle{
   width:11px;
   height:11px;
   background:transparent url(ext-3.0.0/resources/images/default/sizer/square.gif) no-repeat;
   margin:0px;

}

  1. custom-rzwrap .x-resizable-handle-east, #custom-rzwrap .x-resizable-handle-west{
   top:45%;

}

  1. custom-rzwrap .x-resizable-handle-north, #custom-rzwrap .x-resizable-handle-south{
   left:45%;

} </style> </head> <body>

Resizable Examples

These examples show how to apply a floating (default) and pinned Resizable component to a standard element.

Basic Example
This is a basic as you get. To resize the box, position your mouse anywhere near the bottom, right or border right edge of the box. This example uses the default "floating" handles.

Resize Me!
<code>var basic = new Ext.Resizable("basic", {
        width: 200,
        height: 100,
        minWidth:100,
        minHeight:50
});</code>

Wrapped Elements
Some elements such as images and textareas don"t allow child elements. In the past, you had to wrap these elements and set up a Resizable with resize child. Resizable will wrap the element, calculate adjustments for borders/padding and offset the handles for you. All you have to do is set "wrap:true". The manual way of specifying a "resizeChild" is still supported as well.

   Pinned Handles
Notice this example has the resize handles "pinned". This is done by setting "pinned:true".

   Dynamic Sizing
If you don"t like the proxy resizing, you can also turn on dynamic sizing. Just set "dynamic:true".

Here"s a textarea that is wrapped, has pinned handles and has dynamic sizing turned on.

<textarea id="dwrapped"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo. </textarea>

And look how simple the code is, even my grandma could write it.

<code>var dwrapped = new Ext.Resizable("dwrapped", {
    wrap:true,
    pinned:true,
    width:450,
    height:150,
    minWidth:200,
    minHeight: 50,
    dynamic: true
});</code>

Preserve Ratio
For some things like images, you will probably want to preserve the ratio of width to height. Just set preserveRatio:true.

<img id="wrapped" src="ext-3.0.0/examples/resizablesara.jpg" width="200" height="250"/>

<code>var wrapped = new Ext.Resizable("wrapped", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true
});</code>

Transparent Handles
If you just want the element to be resizable without any fancy handles, set transparent to true.

<img id="transparent" src="zack.jpg" width="100" height="176"/>

<code>var transparent = new Ext.Resizable("transparent", {
    wrap:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    transparent:true
});</code>

Customizable Handles
Resizable elements are resizable 8 ways. 8 way resizing for a static positioned element will cause the element to be positioned relative and taken out of the document flow. For resizing which adjusts the x and y of the element, the element should be positioned absolute. You can also control which handles are displayed by setting the "handles" attribute. The handles are styled using CSS so they can be customized to look however you would like them to.

This image has 8 way resizing, custom handles, is draggable and 8 way preserved ratio (that wasn"t easy!).
Double click anywhere on the image to hide it when you are done.

<img id="custom" src="sara_and_zack.jpg" width="200" height="152" style="position:absolute;left:0;top:0;"/>

<button id="showMe">Show Me</button>
<code>var custom = new Ext.Resizable("custom", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    dynamic:true,
    handles: "all", // shorthand for "n s e w ne nw se sw"
    draggable:true
});</code>

Snapping
Resizable also supports basic snapping in increments.

<code>var snap = new Ext.Resizable("snap", {
    pinned:true,
    width:250,
    height:100,
    handles: "e",
    widthIncrement:50,
    minWidth: 50,
    dynamic: true
});
</code>

Warning: Snapping and preserveRatio conflict and can not be used together.


Animated Transitions
Resize operations can also be animated. Animations support configurable easing and duration. Here"s a very basic clone of the first element, but with animation turned on. I used a "backIn" easing and made it a little slower than default.

Animate Me!
<code>var animated = new Ext.Resizable("animated", {
    width: 200,
    height: 100,
    minWidth:100,
    minHeight:50,
    animate:true,
    easing: "backIn",
    duration:.6
});</code>

Warning: for obvious reasons animate and dynamic resizing can not be used together. </body> </html>


 </source>
   
  


Create resizable area

   <source lang="html4strict">
 


<html> <head> <title>Hello World Window</title> <link rel="stylesheet" type="text/css" href="ext-3.0.0/resources/css/ext-all.css" /> <script type="text/javascript" src="ext-3.0.0/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext-3.0.0/ext-all.js"></script> <script language="javascript" > /*!

* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.ru
* http://www.extjs.ru/license
*/

var ResizableExample = {

   init : function(){
       
       var basic = new Ext.Resizable("basic", {
               width: 200,
               height: 100,
               minWidth:100,
               minHeight:50
       });
       
       var animated = new Ext.Resizable("animated", {
               width: 200,
               pinned: true,
               height: 100,
               minWidth:100,
               minHeight:50,
               animate:true,
               easing: "backIn",
               duration:.6
       });
       
       var wrapped = new Ext.Resizable("wrapped", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true
       });
       
       var transparent = new Ext.Resizable("transparent", {
           wrap:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           transparent:true
       });
       
       var custom = new Ext.Resizable("custom", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           handles: "all",
           draggable:true,
           dynamic:true
       });
       var customEl = custom.getEl();
       // move to the body to prevent overlap on my blog
       document.body.insertBefore(customEl.dom, document.body.firstChild);
       
       customEl.on("dblclick", function(){
           customEl.hide(true);
       });
       customEl.hide();
       
       Ext.get("showMe").on("click", function(){
           customEl.center();
           customEl.show(true);
       });
       
       var dwrapped = new Ext.Resizable("dwrapped", {
           wrap:true,
           pinned:true,
           width:450,
           height:150,
           minWidth:200,
           minHeight: 50,
           dynamic: true
       });
       
       var snap = new Ext.Resizable("snap", {
           pinned:true,
           width:250,
           height:100,
           handles: "e",
           widthIncrement:50,
           minWidth: 50,
           dynamic: true
       });
   }

}; Ext.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true); </script> <style type="text/css">

  1. basic, #animated {
   border:1px solid #c3daf9;
   color:#1e4e8f;
   font:bold 14px tahoma,verdana,helvetica;
   text-align:center;
   padding-top:20px;

}

  1. snap {
   border:1px solid #c3daf9;
   overflow:hidden;

}

  1. custom {
   cursor:move;

}

  1. custom-rzwrap{
   z-index: 100;

}

  1. custom-rzwrap .x-resizable-handle{
   width:11px;
   height:11px;
   background:transparent url(ext-3.0.0/resources/images/default/sizer/square.gif) no-repeat;
   margin:0px;

}

  1. custom-rzwrap .x-resizable-handle-east, #custom-rzwrap .x-resizable-handle-west{
   top:45%;

}

  1. custom-rzwrap .x-resizable-handle-north, #custom-rzwrap .x-resizable-handle-south{
   left:45%;

} </style> </head> <body>

Resizable Examples

These examples show how to apply a floating (default) and pinned Resizable component to a standard element.

Basic Example
This is a basic as you get. To resize the box, position your mouse anywhere near the bottom, right or border right edge of the box. This example uses the default "floating" handles.

Resize Me!

</body> </html>


 </source>
   
  


Customizable Handles resizable area

   <source lang="html4strict">
 


<html> <head> <title>Hello World Window</title> <link rel="stylesheet" type="text/css" href="ext-3.0.0/resources/css/ext-all.css" /> <script type="text/javascript" src="ext-3.0.0/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext-3.0.0/ext-all.js"></script> <script language="javascript" > /*!

* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.ru
* http://www.extjs.ru/license
*/

var ResizableExample = {

   init : function(){
       
       var basic = new Ext.Resizable("basic", {
               width: 200,
               height: 100,
               minWidth:100,
               minHeight:50
       });
       
       var animated = new Ext.Resizable("animated", {
               width: 200,
               pinned: true,
               height: 100,
               minWidth:100,
               minHeight:50,
               animate:true,
               easing: "backIn",
               duration:.6
       });
       
       var wrapped = new Ext.Resizable("wrapped", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true
       });
       
       var transparent = new Ext.Resizable("transparent", {
           wrap:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           transparent:true
       });
       
       var custom = new Ext.Resizable("custom", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           handles: "all",
           draggable:true,
           dynamic:true
       });
       var customEl = custom.getEl();
       // move to the body to prevent overlap on my blog
       document.body.insertBefore(customEl.dom, document.body.firstChild);
       
       customEl.on("dblclick", function(){
           customEl.hide(true);
       });
       customEl.hide();
       
       Ext.get("showMe").on("click", function(){
           customEl.center();
           customEl.show(true);
       });
       
       var dwrapped = new Ext.Resizable("dwrapped", {
           wrap:true,
           pinned:true,
           width:450,
           height:150,
           minWidth:200,
           minHeight: 50,
           dynamic: true
       });
       
       var snap = new Ext.Resizable("snap", {
           pinned:true,
           width:250,
           height:100,
           handles: "e",
           widthIncrement:50,
           minWidth: 50,
           dynamic: true
       });
   }

}; Ext.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true); </script> <style type="text/css">

  1. basic, #animated {
   border:1px solid #c3daf9;
   color:#1e4e8f;
   font:bold 14px tahoma,verdana,helvetica;
   text-align:center;
   padding-top:20px;

}

  1. snap {
   border:1px solid #c3daf9;
   overflow:hidden;

}

  1. custom {
   cursor:move;

}

  1. custom-rzwrap{
   z-index: 100;

}

  1. custom-rzwrap .x-resizable-handle{
   width:11px;
   height:11px;
   background:transparent url(ext-3.0.0/resources/images/default/sizer/square.gif) no-repeat;
   margin:0px;

}

  1. custom-rzwrap .x-resizable-handle-east, #custom-rzwrap .x-resizable-handle-west{
   top:45%;

}

  1. custom-rzwrap .x-resizable-handle-north, #custom-rzwrap .x-resizable-handle-south{
   left:45%;

} </style> </head> <body>

Resizable Examples

These examples show how to apply a floating (default) and pinned Resizable component to a standard element.

Basic Example
This is a basic as you get. To resize the box, position your mouse anywhere near the bottom, right or border right edge of the box. This example uses the default "floating" handles.

Resize Me!
<code>var basic = new Ext.Resizable("basic", {
        width: 200,
        height: 100,
        minWidth:100,
        minHeight:50
});</code>

Wrapped Elements
Some elements such as images and textareas don"t allow child elements. In the past, you had to wrap these elements and set up a Resizable with resize child. Resizable will wrap the element, calculate adjustments for borders/padding and offset the handles for you. All you have to do is set "wrap:true". The manual way of specifying a "resizeChild" is still supported as well.

   Pinned Handles
Notice this example has the resize handles "pinned". This is done by setting "pinned:true".

   Dynamic Sizing
If you don"t like the proxy resizing, you can also turn on dynamic sizing. Just set "dynamic:true".

Here"s a textarea that is wrapped, has pinned handles and has dynamic sizing turned on.

<textarea id="dwrapped"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo. </textarea>

And look how simple the code is, even my grandma could write it.

<code>var dwrapped = new Ext.Resizable("dwrapped", {
    wrap:true,
    pinned:true,
    width:450,
    height:150,
    minWidth:200,
    minHeight: 50,
    dynamic: true
});</code>

Preserve Ratio
For some things like images, you will probably want to preserve the ratio of width to height. Just set preserveRatio:true.

<img id="wrapped" src="ext-3.0.0/examples/resizablesara.jpg" width="200" height="250"/>

<code>var wrapped = new Ext.Resizable("wrapped", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true
});</code>

Transparent Handles
If you just want the element to be resizable without any fancy handles, set transparent to true.

<img id="transparent" src="zack.jpg" width="100" height="176"/>

<code>var transparent = new Ext.Resizable("transparent", {
    wrap:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    transparent:true
});</code>

Customizable Handles
Resizable elements are resizable 8 ways. 8 way resizing for a static positioned element will cause the element to be positioned relative and taken out of the document flow. For resizing which adjusts the x and y of the element, the element should be positioned absolute. You can also control which handles are displayed by setting the "handles" attribute. The handles are styled using CSS so they can be customized to look however you would like them to.

This image has 8 way resizing, custom handles, is draggable and 8 way preserved ratio (that wasn"t easy!).
Double click anywhere on the image to hide it when you are done.

<img id="custom" src="sara_and_zack.jpg" width="200" height="152" style="position:absolute;left:0;top:0;"/>

<button id="showMe">Show Me</button>
<code>var custom = new Ext.Resizable("custom", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    dynamic:true,
    handles: "all", // shorthand for "n s e w ne nw se sw"
    draggable:true
});</code>

Snapping
Resizable also supports basic snapping in increments.

<code>var snap = new Ext.Resizable("snap", {
    pinned:true,
    width:250,
    height:100,
    handles: "e",
    widthIncrement:50,
    minWidth: 50,
    dynamic: true
});
</code>

Warning: Snapping and preserveRatio conflict and can not be used together.


Animated Transitions
Resize operations can also be animated. Animations support configurable easing and duration. Here"s a very basic clone of the first element, but with animation turned on. I used a "backIn" easing and made it a little slower than default.

Animate Me!
<code>var animated = new Ext.Resizable("animated", {
    width: 200,
    height: 100,
    minWidth:100,
    minHeight:50,
    animate:true,
    easing: "backIn",
    duration:.6
});</code>

Warning: for obvious reasons animate and dynamic resizing can not be used together. </body> </html>


 </source>
   
  


Preserve Ratio resizable area

   <source lang="html4strict">
 


<html> <head> <title>Hello World Window</title> <link rel="stylesheet" type="text/css" href="ext-3.0.0/resources/css/ext-all.css" /> <script type="text/javascript" src="ext-3.0.0/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext-3.0.0/ext-all.js"></script> <script language="javascript" > /*!

* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.ru
* http://www.extjs.ru/license
*/

var ResizableExample = {

   init : function(){
       
       var basic = new Ext.Resizable("basic", {
               width: 200,
               height: 100,
               minWidth:100,
               minHeight:50
       });
       
       var animated = new Ext.Resizable("animated", {
               width: 200,
               pinned: true,
               height: 100,
               minWidth:100,
               minHeight:50,
               animate:true,
               easing: "backIn",
               duration:.6
       });
       
       var wrapped = new Ext.Resizable("wrapped", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true
       });
       
       var transparent = new Ext.Resizable("transparent", {
           wrap:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           transparent:true
       });
       
       var custom = new Ext.Resizable("custom", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           handles: "all",
           draggable:true,
           dynamic:true
       });
       var customEl = custom.getEl();
       // move to the body to prevent overlap on my blog
       document.body.insertBefore(customEl.dom, document.body.firstChild);
       
       customEl.on("dblclick", function(){
           customEl.hide(true);
       });
       customEl.hide();
       
       Ext.get("showMe").on("click", function(){
           customEl.center();
           customEl.show(true);
       });
       
       var dwrapped = new Ext.Resizable("dwrapped", {
           wrap:true,
           pinned:true,
           width:450,
           height:150,
           minWidth:200,
           minHeight: 50,
           dynamic: true
       });
       
       var snap = new Ext.Resizable("snap", {
           pinned:true,
           width:250,
           height:100,
           handles: "e",
           widthIncrement:50,
           minWidth: 50,
           dynamic: true
       });
   }

}; Ext.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true); </script> <style type="text/css">

  1. basic, #animated {
   border:1px solid #c3daf9;
   color:#1e4e8f;
   font:bold 14px tahoma,verdana,helvetica;
   text-align:center;
   padding-top:20px;

}

  1. snap {
   border:1px solid #c3daf9;
   overflow:hidden;

}

  1. custom {
   cursor:move;

}

  1. custom-rzwrap{
   z-index: 100;

}

  1. custom-rzwrap .x-resizable-handle{
   width:11px;
   height:11px;
   background:transparent url(ext-3.0.0/resources/images/default/sizer/square.gif) no-repeat;
   margin:0px;

}

  1. custom-rzwrap .x-resizable-handle-east, #custom-rzwrap .x-resizable-handle-west{
   top:45%;

}

  1. custom-rzwrap .x-resizable-handle-north, #custom-rzwrap .x-resizable-handle-south{
   left:45%;

} </style> </head> <body>

Resizable Examples

These examples show how to apply a floating (default) and pinned Resizable component to a standard element.

Basic Example
This is a basic as you get. To resize the box, position your mouse anywhere near the bottom, right or border right edge of the box. This example uses the default "floating" handles.

Resize Me!
<code>var basic = new Ext.Resizable("basic", {
        width: 200,
        height: 100,
        minWidth:100,
        minHeight:50
});</code>

Wrapped Elements
Some elements such as images and textareas don"t allow child elements. In the past, you had to wrap these elements and set up a Resizable with resize child. Resizable will wrap the element, calculate adjustments for borders/padding and offset the handles for you. All you have to do is set "wrap:true". The manual way of specifying a "resizeChild" is still supported as well.

   Pinned Handles
Notice this example has the resize handles "pinned". This is done by setting "pinned:true".

   Dynamic Sizing
If you don"t like the proxy resizing, you can also turn on dynamic sizing. Just set "dynamic:true".

Here"s a textarea that is wrapped, has pinned handles and has dynamic sizing turned on.

<textarea id="dwrapped"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo. </textarea>

And look how simple the code is, even my grandma could write it.

<code>var dwrapped = new Ext.Resizable("dwrapped", {
    wrap:true,
    pinned:true,
    width:450,
    height:150,
    minWidth:200,
    minHeight: 50,
    dynamic: true
});</code>

Preserve Ratio
For some things like images, you will probably want to preserve the ratio of width to height. Just set preserveRatio:true.

<img id="wrapped" src="ext-3.0.0/examples/resizablesara.jpg" width="200" height="250"/>

<code>var wrapped = new Ext.Resizable("wrapped", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true
});</code>

Transparent Handles
If you just want the element to be resizable without any fancy handles, set transparent to true.

<img id="transparent" src="zack.jpg" width="100" height="176"/>

<code>var transparent = new Ext.Resizable("transparent", {
    wrap:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    transparent:true
});</code>

Customizable Handles
Resizable elements are resizable 8 ways. 8 way resizing for a static positioned element will cause the element to be positioned relative and taken out of the document flow. For resizing which adjusts the x and y of the element, the element should be positioned absolute. You can also control which handles are displayed by setting the "handles" attribute. The handles are styled using CSS so they can be customized to look however you would like them to.

This image has 8 way resizing, custom handles, is draggable and 8 way preserved ratio (that wasn"t easy!).
Double click anywhere on the image to hide it when you are done.

<img id="custom" src="sara_and_zack.jpg" width="200" height="152" style="position:absolute;left:0;top:0;"/>

<button id="showMe">Show Me</button>
<code>var custom = new Ext.Resizable("custom", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    dynamic:true,
    handles: "all", // shorthand for "n s e w ne nw se sw"
    draggable:true
});</code>

Snapping
Resizable also supports basic snapping in increments.

<code>var snap = new Ext.Resizable("snap", {
    pinned:true,
    width:250,
    height:100,
    handles: "e",
    widthIncrement:50,
    minWidth: 50,
    dynamic: true
});
</code>

Warning: Snapping and preserveRatio conflict and can not be used together.


Animated Transitions
Resize operations can also be animated. Animations support configurable easing and duration. Here"s a very basic clone of the first element, but with animation turned on. I used a "backIn" easing and made it a little slower than default.

Animate Me!
<code>var animated = new Ext.Resizable("animated", {
    width: 200,
    height: 100,
    minWidth:100,
    minHeight:50,
    animate:true,
    easing: "backIn",
    duration:.6
});</code>

Warning: for obvious reasons animate and dynamic resizing can not be used together. </body> </html>


 </source>
   
  


Resizable also supports basic snapping in increments.

   <source lang="html4strict">
 


<html> <head> <title>Hello World Window</title> <link rel="stylesheet" type="text/css" href="ext-3.0.0/resources/css/ext-all.css" /> <script type="text/javascript" src="ext-3.0.0/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext-3.0.0/ext-all.js"></script> <script language="javascript" > /*!

* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.ru
* http://www.extjs.ru/license
*/

var ResizableExample = {

   init : function(){
       
       var basic = new Ext.Resizable("basic", {
               width: 200,
               height: 100,
               minWidth:100,
               minHeight:50
       });
       
       var animated = new Ext.Resizable("animated", {
               width: 200,
               pinned: true,
               height: 100,
               minWidth:100,
               minHeight:50,
               animate:true,
               easing: "backIn",
               duration:.6
       });
       
       var wrapped = new Ext.Resizable("wrapped", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true
       });
       
       var transparent = new Ext.Resizable("transparent", {
           wrap:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           transparent:true
       });
       
       var custom = new Ext.Resizable("custom", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           handles: "all",
           draggable:true,
           dynamic:true
       });
       var customEl = custom.getEl();
       // move to the body to prevent overlap on my blog
       document.body.insertBefore(customEl.dom, document.body.firstChild);
       
       customEl.on("dblclick", function(){
           customEl.hide(true);
       });
       customEl.hide();
       
       Ext.get("showMe").on("click", function(){
           customEl.center();
           customEl.show(true);
       });
       
       var dwrapped = new Ext.Resizable("dwrapped", {
           wrap:true,
           pinned:true,
           width:450,
           height:150,
           minWidth:200,
           minHeight: 50,
           dynamic: true
       });
       
       var snap = new Ext.Resizable("snap", {
           pinned:true,
           width:250,
           height:100,
           handles: "e",
           widthIncrement:50,
           minWidth: 50,
           dynamic: true
       });
   }

}; Ext.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true); </script> <style type="text/css">

  1. basic, #animated {
   border:1px solid #c3daf9;
   color:#1e4e8f;
   font:bold 14px tahoma,verdana,helvetica;
   text-align:center;
   padding-top:20px;

}

  1. snap {
   border:1px solid #c3daf9;
   overflow:hidden;

}

  1. custom {
   cursor:move;

}

  1. custom-rzwrap{
   z-index: 100;

}

  1. custom-rzwrap .x-resizable-handle{
   width:11px;
   height:11px;
   background:transparent url(ext-3.0.0/resources/images/default/sizer/square.gif) no-repeat;
   margin:0px;

}

  1. custom-rzwrap .x-resizable-handle-east, #custom-rzwrap .x-resizable-handle-west{
   top:45%;

}

  1. custom-rzwrap .x-resizable-handle-north, #custom-rzwrap .x-resizable-handle-south{
   left:45%;

} </style> </head> <body>

Resizable Examples

These examples show how to apply a floating (default) and pinned Resizable component to a standard element.

Basic Example
This is a basic as you get. To resize the box, position your mouse anywhere near the bottom, right or border right edge of the box. This example uses the default "floating" handles.

Resize Me!
<code>var basic = new Ext.Resizable("basic", {
        width: 200,
        height: 100,
        minWidth:100,
        minHeight:50
});</code>

Wrapped Elements
Some elements such as images and textareas don"t allow child elements. In the past, you had to wrap these elements and set up a Resizable with resize child. Resizable will wrap the element, calculate adjustments for borders/padding and offset the handles for you. All you have to do is set "wrap:true". The manual way of specifying a "resizeChild" is still supported as well.

   Pinned Handles
Notice this example has the resize handles "pinned". This is done by setting "pinned:true".

   Dynamic Sizing
If you don"t like the proxy resizing, you can also turn on dynamic sizing. Just set "dynamic:true".

Here"s a textarea that is wrapped, has pinned handles and has dynamic sizing turned on.

<textarea id="dwrapped"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo. </textarea>

And look how simple the code is, even my grandma could write it.

<code>var dwrapped = new Ext.Resizable("dwrapped", {
    wrap:true,
    pinned:true,
    width:450,
    height:150,
    minWidth:200,
    minHeight: 50,
    dynamic: true
});</code>

Preserve Ratio
For some things like images, you will probably want to preserve the ratio of width to height. Just set preserveRatio:true.

<img id="wrapped" src="ext-3.0.0/examples/resizablesara.jpg" width="200" height="250"/>

<code>var wrapped = new Ext.Resizable("wrapped", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true
});</code>

Transparent Handles
If you just want the element to be resizable without any fancy handles, set transparent to true.

<img id="transparent" src="zack.jpg" width="100" height="176"/>

<code>var transparent = new Ext.Resizable("transparent", {
    wrap:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    transparent:true
});</code>

Customizable Handles
Resizable elements are resizable 8 ways. 8 way resizing for a static positioned element will cause the element to be positioned relative and taken out of the document flow. For resizing which adjusts the x and y of the element, the element should be positioned absolute. You can also control which handles are displayed by setting the "handles" attribute. The handles are styled using CSS so they can be customized to look however you would like them to.

This image has 8 way resizing, custom handles, is draggable and 8 way preserved ratio (that wasn"t easy!).
Double click anywhere on the image to hide it when you are done.

<img id="custom" src="sara_and_zack.jpg" width="200" height="152" style="position:absolute;left:0;top:0;"/>

<button id="showMe">Show Me</button>
<code>var custom = new Ext.Resizable("custom", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    dynamic:true,
    handles: "all", // shorthand for "n s e w ne nw se sw"
    draggable:true
});</code>

Snapping
Resizable also supports basic snapping in increments.

<code>var snap = new Ext.Resizable("snap", {
    pinned:true,
    width:250,
    height:100,
    handles: "e",
    widthIncrement:50,
    minWidth: 50,
    dynamic: true
});
</code>

Warning: Snapping and preserveRatio conflict and can not be used together.


Animated Transitions
Resize operations can also be animated. Animations support configurable easing and duration. Here"s a very basic clone of the first element, but with animation turned on. I used a "backIn" easing and made it a little slower than default.

Animate Me!
<code>var animated = new Ext.Resizable("animated", {
    width: 200,
    height: 100,
    minWidth:100,
    minHeight:50,
    animate:true,
    easing: "backIn",
    duration:.6
});</code>

Warning: for obvious reasons animate and dynamic resizing can not be used together. </body> </html>


 </source>
   
  


Transparent Handles resizable area

   <source lang="html4strict">
 


<html> <head> <title>Hello World Window</title> <link rel="stylesheet" type="text/css" href="ext-3.0.0/resources/css/ext-all.css" /> <script type="text/javascript" src="ext-3.0.0/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext-3.0.0/ext-all.js"></script> <script language="javascript" > /*!

* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.ru
* http://www.extjs.ru/license
*/

var ResizableExample = {

   init : function(){
       
       var basic = new Ext.Resizable("basic", {
               width: 200,
               height: 100,
               minWidth:100,
               minHeight:50
       });
       
       var animated = new Ext.Resizable("animated", {
               width: 200,
               pinned: true,
               height: 100,
               minWidth:100,
               minHeight:50,
               animate:true,
               easing: "backIn",
               duration:.6
       });
       
       var wrapped = new Ext.Resizable("wrapped", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true
       });
       
       var transparent = new Ext.Resizable("transparent", {
           wrap:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           transparent:true
       });
       
       var custom = new Ext.Resizable("custom", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           handles: "all",
           draggable:true,
           dynamic:true
       });
       var customEl = custom.getEl();
       // move to the body to prevent overlap on my blog
       document.body.insertBefore(customEl.dom, document.body.firstChild);
       
       customEl.on("dblclick", function(){
           customEl.hide(true);
       });
       customEl.hide();
       
       Ext.get("showMe").on("click", function(){
           customEl.center();
           customEl.show(true);
       });
       
       var dwrapped = new Ext.Resizable("dwrapped", {
           wrap:true,
           pinned:true,
           width:450,
           height:150,
           minWidth:200,
           minHeight: 50,
           dynamic: true
       });
       
       var snap = new Ext.Resizable("snap", {
           pinned:true,
           width:250,
           height:100,
           handles: "e",
           widthIncrement:50,
           minWidth: 50,
           dynamic: true
       });
   }

}; Ext.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true); </script> <style type="text/css">

  1. basic, #animated {
   border:1px solid #c3daf9;
   color:#1e4e8f;
   font:bold 14px tahoma,verdana,helvetica;
   text-align:center;
   padding-top:20px;

}

  1. snap {
   border:1px solid #c3daf9;
   overflow:hidden;

}

  1. custom {
   cursor:move;

}

  1. custom-rzwrap{
   z-index: 100;

}

  1. custom-rzwrap .x-resizable-handle{
   width:11px;
   height:11px;
   background:transparent url(ext-3.0.0/resources/images/default/sizer/square.gif) no-repeat;
   margin:0px;

}

  1. custom-rzwrap .x-resizable-handle-east, #custom-rzwrap .x-resizable-handle-west{
   top:45%;

}

  1. custom-rzwrap .x-resizable-handle-north, #custom-rzwrap .x-resizable-handle-south{
   left:45%;

} </style> </head> <body>

Resizable Examples

These examples show how to apply a floating (default) and pinned Resizable component to a standard element.

Basic Example
This is a basic as you get. To resize the box, position your mouse anywhere near the bottom, right or border right edge of the box. This example uses the default "floating" handles.

Resize Me!
<code>var basic = new Ext.Resizable("basic", {
        width: 200,
        height: 100,
        minWidth:100,
        minHeight:50
});</code>

Wrapped Elements
Some elements such as images and textareas don"t allow child elements. In the past, you had to wrap these elements and set up a Resizable with resize child. Resizable will wrap the element, calculate adjustments for borders/padding and offset the handles for you. All you have to do is set "wrap:true". The manual way of specifying a "resizeChild" is still supported as well.

   Pinned Handles
Notice this example has the resize handles "pinned". This is done by setting "pinned:true".

   Dynamic Sizing
If you don"t like the proxy resizing, you can also turn on dynamic sizing. Just set "dynamic:true".

Here"s a textarea that is wrapped, has pinned handles and has dynamic sizing turned on.

<textarea id="dwrapped"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo. </textarea>

And look how simple the code is, even my grandma could write it.

<code>var dwrapped = new Ext.Resizable("dwrapped", {
    wrap:true,
    pinned:true,
    width:450,
    height:150,
    minWidth:200,
    minHeight: 50,
    dynamic: true
});</code>

Preserve Ratio
For some things like images, you will probably want to preserve the ratio of width to height. Just set preserveRatio:true.

<img id="wrapped" src="ext-3.0.0/examples/resizablesara.jpg" width="200" height="250"/>

<code>var wrapped = new Ext.Resizable("wrapped", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true
});</code>

Transparent Handles
If you just want the element to be resizable without any fancy handles, set transparent to true.

<img id="transparent" src="zack.jpg" width="100" height="176"/>

<code>var transparent = new Ext.Resizable("transparent", {
    wrap:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    transparent:true
});</code>

Customizable Handles
Resizable elements are resizable 8 ways. 8 way resizing for a static positioned element will cause the element to be positioned relative and taken out of the document flow. For resizing which adjusts the x and y of the element, the element should be positioned absolute. You can also control which handles are displayed by setting the "handles" attribute. The handles are styled using CSS so they can be customized to look however you would like them to.

This image has 8 way resizing, custom handles, is draggable and 8 way preserved ratio (that wasn"t easy!).
Double click anywhere on the image to hide it when you are done.

<img id="custom" src="sara_and_zack.jpg" width="200" height="152" style="position:absolute;left:0;top:0;"/>

<button id="showMe">Show Me</button>
<code>var custom = new Ext.Resizable("custom", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    dynamic:true,
    handles: "all", // shorthand for "n s e w ne nw se sw"
    draggable:true
});</code>

Snapping
Resizable also supports basic snapping in increments.

<code>var snap = new Ext.Resizable("snap", {
    pinned:true,
    width:250,
    height:100,
    handles: "e",
    widthIncrement:50,
    minWidth: 50,
    dynamic: true
});
</code>

Warning: Snapping and preserveRatio conflict and can not be used together.


Animated Transitions
Resize operations can also be animated. Animations support configurable easing and duration. Here"s a very basic clone of the first element, but with animation turned on. I used a "backIn" easing and made it a little slower than default.

Animate Me!
<code>var animated = new Ext.Resizable("animated", {
    width: 200,
    height: 100,
    minWidth:100,
    minHeight:50,
    animate:true,
    easing: "backIn",
    duration:.6
});</code>

Warning: for obvious reasons animate and dynamic resizing can not be used together. </body> </html>


 </source>
   
  


Wrap tag into a resizable area

   <source lang="html4strict">
 


<html> <head> <title>Hello World Window</title> <link rel="stylesheet" type="text/css" href="ext-3.0.0/resources/css/ext-all.css" /> <script type="text/javascript" src="ext-3.0.0/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext-3.0.0/ext-all.js"></script> <script language="javascript" > /*!

* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.ru
* http://www.extjs.ru/license
*/

var ResizableExample = {

   init : function(){
       
       var basic = new Ext.Resizable("basic", {
               width: 200,
               height: 100,
               minWidth:100,
               minHeight:50
       });
       
       var animated = new Ext.Resizable("animated", {
               width: 200,
               pinned: true,
               height: 100,
               minWidth:100,
               minHeight:50,
               animate:true,
               easing: "backIn",
               duration:.6
       });
       
       var wrapped = new Ext.Resizable("wrapped", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true
       });
       
       var transparent = new Ext.Resizable("transparent", {
           wrap:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           transparent:true
       });
       
       var custom = new Ext.Resizable("custom", {
           wrap:true,
           pinned:true,
           minWidth:50,
           minHeight: 50,
           preserveRatio: true,
           handles: "all",
           draggable:true,
           dynamic:true
       });
       var customEl = custom.getEl();
       // move to the body to prevent overlap on my blog
       document.body.insertBefore(customEl.dom, document.body.firstChild);
       
       customEl.on("dblclick", function(){
           customEl.hide(true);
       });
       customEl.hide();
       
       Ext.get("showMe").on("click", function(){
           customEl.center();
           customEl.show(true);
       });
       
       var dwrapped = new Ext.Resizable("dwrapped", {
           wrap:true,
           pinned:true,
           width:450,
           height:150,
           minWidth:200,
           minHeight: 50,
           dynamic: true
       });
       
       var snap = new Ext.Resizable("snap", {
           pinned:true,
           width:250,
           height:100,
           handles: "e",
           widthIncrement:50,
           minWidth: 50,
           dynamic: true
       });
   }

}; Ext.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true); </script> <style type="text/css">

  1. basic, #animated {
   border:1px solid #c3daf9;
   color:#1e4e8f;
   font:bold 14px tahoma,verdana,helvetica;
   text-align:center;
   padding-top:20px;

}

  1. snap {
   border:1px solid #c3daf9;
   overflow:hidden;

}

  1. custom {
   cursor:move;

}

  1. custom-rzwrap{
   z-index: 100;

}

  1. custom-rzwrap .x-resizable-handle{
   width:11px;
   height:11px;
   background:transparent url(ext-3.0.0/resources/images/default/sizer/square.gif) no-repeat;
   margin:0px;

}

  1. custom-rzwrap .x-resizable-handle-east, #custom-rzwrap .x-resizable-handle-west{
   top:45%;

}

  1. custom-rzwrap .x-resizable-handle-north, #custom-rzwrap .x-resizable-handle-south{
   left:45%;

} </style> </head> <body>

Resizable Examples

These examples show how to apply a floating (default) and pinned Resizable component to a standard element.

Basic Example
This is a basic as you get. To resize the box, position your mouse anywhere near the bottom, right or border right edge of the box. This example uses the default "floating" handles.

Resize Me!
<code>var basic = new Ext.Resizable("basic", {
        width: 200,
        height: 100,
        minWidth:100,
        minHeight:50
});</code>

Wrapped Elements
Some elements such as images and textareas don"t allow child elements. In the past, you had to wrap these elements and set up a Resizable with resize child. Resizable will wrap the element, calculate adjustments for borders/padding and offset the handles for you. All you have to do is set "wrap:true". The manual way of specifying a "resizeChild" is still supported as well.

   Pinned Handles
Notice this example has the resize handles "pinned". This is done by setting "pinned:true".

   Dynamic Sizing
If you don"t like the proxy resizing, you can also turn on dynamic sizing. Just set "dynamic:true".

Here"s a textarea that is wrapped, has pinned handles and has dynamic sizing turned on.

<textarea id="dwrapped"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo. </textarea>

And look how simple the code is, even my grandma could write it.

<code>var dwrapped = new Ext.Resizable("dwrapped", {
    wrap:true,
    pinned:true,
    width:450,
    height:150,
    minWidth:200,
    minHeight: 50,
    dynamic: true
});</code>

Preserve Ratio
For some things like images, you will probably want to preserve the ratio of width to height. Just set preserveRatio:true.

<img id="wrapped" src="ext-3.0.0/examples/resizablesara.jpg" width="200" height="250"/>

<code>var wrapped = new Ext.Resizable("wrapped", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true
});</code>

Transparent Handles
If you just want the element to be resizable without any fancy handles, set transparent to true.

<img id="transparent" src="zack.jpg" width="100" height="176"/>

<code>var transparent = new Ext.Resizable("transparent", {
    wrap:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    transparent:true
});</code>

Customizable Handles
Resizable elements are resizable 8 ways. 8 way resizing for a static positioned element will cause the element to be positioned relative and taken out of the document flow. For resizing which adjusts the x and y of the element, the element should be positioned absolute. You can also control which handles are displayed by setting the "handles" attribute. The handles are styled using CSS so they can be customized to look however you would like them to.

This image has 8 way resizing, custom handles, is draggable and 8 way preserved ratio (that wasn"t easy!).
Double click anywhere on the image to hide it when you are done.

<img id="custom" src="sara_and_zack.jpg" width="200" height="152" style="position:absolute;left:0;top:0;"/>

<button id="showMe">Show Me</button>
<code>var custom = new Ext.Resizable("custom", {
    wrap:true,
    pinned:true,
    minWidth:50,
    minHeight: 50,
    preserveRatio: true,
    dynamic:true,
    handles: "all", // shorthand for "n s e w ne nw se sw"
    draggable:true
});</code>

Snapping
Resizable also supports basic snapping in increments.

<code>var snap = new Ext.Resizable("snap", {
    pinned:true,
    width:250,
    height:100,
    handles: "e",
    widthIncrement:50,
    minWidth: 50,
    dynamic: true
});
</code>

Warning: Snapping and preserveRatio conflict and can not be used together.


Animated Transitions
Resize operations can also be animated. Animations support configurable easing and duration. Here"s a very basic clone of the first element, but with animation turned on. I used a "backIn" easing and made it a little slower than default.

Animate Me!
<code>var animated = new Ext.Resizable("animated", {
    width: 200,
    height: 100,
    minWidth:100,
    minHeight:50,
    animate:true,
    easing: "backIn",
    duration:.6
});</code>

Warning: for obvious reasons animate and dynamic resizing can not be used together. </body> </html>


 </source>