참 오랜만에 글을 올립니다...

여태 안쓰던 OnResize를 써봤는데요..
좀 이상해서요..

API 문서에 있는 예제를 수정한 것인데..
정상적이라면

OnResize(width, height)
를 통해 넘어온 width, height 를 사용할 수 있어야 할텐데..
아래와 같이 하면 .. undefined 가 뜨는군요.. alert 해봐도.
API문서에 있는 예제를 거의 그대로 복사해넣은것인데...
...

IE나 Firefox나 마찬가지더군요...
IE에서는 창의 크기를 바꿀때 바꾸면서도 줄줄이 OnResize가 뜨지만..
FireFox에서는 창의 크기를 모두 바꾸고 나면(드래그가 끝나면) OnResize 가
뜬다는 차이는 있지만..
역시 둘다 정상적으로 값이 들어오지 않네요..

OnResize로 들어오는 값이 위젯의 크기를 넘겨주는것이겠죠?..
위젯 크기에 따라 버튼의 배열을 달리하려고 하는데..
값이 안들어오니..어떻게 할 수가 없네요..



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:widget="http://wzdapi.com/widget/">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>메모장</title>
<meta name="author" content="WzdWorks" />
<meta name="description" content="간단한 메모장입니다." />
<meta name="apiVersion" content="1.0" />
<widget:preferences>
<preference name="memo" type="hidden" />
</widget:preferences>
<script src="http://wzdapi.com/widget/emulator.js"></script>

<style>
/*<![CDATA[*/

textarea {
  border: 1px solid black;
  width: 100%;
  height: 100%;
  overflow: auto;
}

/*]]>*/
</style>
<script>
//<![CDATA[
var Memo = {
  onChange: function() {
    widget.setValue('memo', this.value);
  }
};
widget.onLoad = function()
{
  var elem = widget.body.getElementsByTagName('textarea')[0];
  elem.value = widget.getValue('memo');
  elem.onchange = Memo.onChange;
};
widget.onResize = function(width, height)
{
//  alert("width : "+width+", height : "+height);
  var elem = widget.body.getElementsByTagName('textarea')[0];
  elem.style.width = width + 'px';
  elem.style.height = height + 200 + 'px';
}
//]]>
</script>
</head>
<body>
<textarea></textarea>
</body>
</html>