moveBy() 예제
<button onclick="openWin()">hzWin 열기</button>
<button onclick="moveWin()">hzWin 이동</button>
<script>
var hzWin;
function openWin() {
hzWin = window.open("", "hzWin", "width=200, height=100");
hzWin.document.write("<p>홈짱닷컴 Homzzang.com</p>");
}
function moveWin() {
hzWin.moveBy(250, 250);
hzWin.focus();
}
</script>
결과보기
※ hzWin 버튼 클릭할 때마다 최초 위치에서 멀어짐.