Created: 2012-08-21 05:11
Updated: 2014-02-20 09:25

Resizable HTML Elements

This is a simple class for making HTML elements easily resizable.


This relies on the Prototype.js Library

##Basic usage:

new Resizable(element [, options]);

element - An id or an element
options - Optional object with options. See Options.


<script type="text/javascript" src="prototype.js"><script>
<script type="text/javascript" src="resizable.js"><script>

<script type="text/javascript">
    document.observe('dom:loaded', function(ev) {
        new Resizable($('elementID'));

##Options | Option | Definition | | ------ | ------ | | default_style | Bool, Default : true Include some default styling for the resizable handle | | class_name | String, Default : 'resizer' Class name for the resizable handle | | onStart | Function, Default : null A function to be called when resizing starts| | onEnd | Function, Default : null A function to be called when resizing ends |

###Advanced Example

//Open example.html to see this in action
<script type="text/javascript" src="tests/lib/prototype.js"></script>
<script type="text/javascript" src="resizable.js"></script>

<script type="text/javascript">
    document.observe('dom:loaded', function(ev) {
        new Resizable($('resize_me'), {
            'onStart': function() {
                console.log('resize start');
            'onEnd': function() {
                console.log('resize end');


Copyright 2012 Cameron Wengert

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more