Create a gist now

Instantly share code, notes, and snippets.

YUI3 Resize with start event
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Resize Example</title>
<style type="text/css">
#demo {
height: 100px;
width: 100px;
border: 1px solid black;
background-color: #8DD5E7;
position: relative;
padding: 1em;
margin: 2em;
<script src=""></script>
<body class="yui3-skin-sam ">
<div id="demo">Resize Me</div>
<script type="text/javascript">
YUI().use('resize', 'resize-plugin', function(Y) {
var resize = new Y.Resize({
//Selector of the node to resize
node: '#demo'
resize.plug(Y.Plugin.ResizeConstrained, {
minWidth: 50,
minHeight: 50,
maxWidth: 300,
maxHeight: 300,
preserveRatio: true
resize.on('resize:start',function(){ alert('fired resize:start event!');});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment