Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
The smallest "resizable" implementation there is
.resizable {
resize: both; /* Options: horizontal, vertical, both */
overflow: auto; /* Options: scroll, hidden, auto */
}
var registerResizeHandler = function (element, handler) {
var width = element.style.width,
height = element.style.height;
element.onmouseup = function () {
if (width !== element.style.width || height !== element.style.height) {
width = element.style.width;
height = element.style.height;
handler(width, height);
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment