定义和用法
moveBy() 方法可相对窗口的当前坐标把它移动指定的像素。
语法
window.moveBy(x,y)
实例
<!DOCTYPE html><html><head><meta charset="gb2312"><title>moveBy</title><script>function openWin(){myWindow=window.open('','','width=200,height=100');myWindow.document.write("<p>这是我的窗口</p>");}function moveWin(){myWindow.moveBy(250,250);myWindow.focus();}</script></head><body><input type="button" value="打开我的窗口" onclick="openWin()"/><br><br><input type="button" value="移动我的窗口" onclick="moveWin()"/></body></html>
运行效果
窗口动态向右下移动250
1048

被折叠的 条评论
为什么被折叠?



