Demo:
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title></title>
<script src="http://yui.yahooapis.com/3.10.0/build/yui/yui-min.js"></script>
<script type="text/javascript" src="js.js"></script>
<style type="text/css">
#demo{width:100px;height:100px;border:solid 1px #000;background:#d72;position:relative;}
#demo.resizing{background:#27d;}
</style>
</head>
<body>
<div id="demo"></div>
</body>
<script type="text/javascript">
YUI().use('resize',function(Y){
var resize=new Y.Resize({node:'#demo'});
resize.on('resize:start',function(){
this.get('node').addClass('resizing');
})
resize.on('resize:end',function(){
this.get('node').removeClass('resizing');
})
})
</script>
</html>