Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
YUI3 Resize with start event
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<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;
}
</style>
<script src="http://yui.yahooapis.com/3.4.0/build/yui/yui-min.js"></script>
</head>
<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!');});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.