var child = window.open('','','width=300, height=200');
var width = screen.width;
var height = screen.height;
child.moveTo(0,0);
child.resizeTo(width, height);
setInterval(function () {
child.resizeBy(-20, -20);
child.moveBy(10, 10);
}, 1000);
window.open
: 코드실행시 넓이 300, 높이 200인 브라우저창을 생성한다.
child.moveTo
: 생성된 브라우저의 x축 y축의 0,0 에 커서가 설정되어있다.
child.resizeTo
: 브라우저의 크기를 재설정한다.
setInterval
: 1초마다 한번씩 함수를 실행시킨다.
child.resizeBy
: x축,y축을 계속해서 -20씩 감소시킨다.
child.moveBy
: x축,y축이 감소됨으로 커서를 10,10씩 이동하여 가운데로 줄어드는 효과를 주었다.