Skip to content

Instantly share code, notes, and snippets.

@slieschke
Created November 8, 2012 20:53
Show Gist options
  • Save slieschke/4041513 to your computer and use it in GitHub Desktop.
Save slieschke/4041513 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<script src="http://yui.yahooapis.com/3.7.3/build/yui/yui-min.js"></script>
<script>
YUI().use('resize', function(Y) {
var resize = new Y.Resize({ node: '#demo' });
// This event fires...
resize.on('start', function() {
Y.one('#debug1').set('innerHTML', new Date());
});
// ... but this one does not.
Y.on('resize:start', function() {
Y.one('#debug2').set('innerHTML', new Date());
});
});
</script>
<style>
#demo {
height: 100px;
width: 100px;
border: 1px solid black;
background-color: #8DD5E7;
position: relative;
padding: 1em;
margin: 2em;
}
</style>
</head>
<body>
<div id="debug1"></div>
<div id="debug2"></div>
<div id="demo">Resize Me</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment