Created
August 24, 2011 17:37
-
-
Save stlsmiths/1168632 to your computer and use it in GitHub Desktop.
YUI3 Resize with start event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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