我正在尝试创建一个HTML站点,该站点通过javascript打开一个窗口,该窗口中有一个使该窗口向右移动的按钮。这是我尝试过的代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Document</title>
<script>
var a= function animate(v)
{
v.moveBy(5,0);
setTimeout(animate(v),1000);
}
window.onload = function () {
var ventana=window.open("","window","width=500px,height=500px,top=" + ((screen.availHeight / 2) - 200 )+ "px");
ventana.document.write("<input type=\"button\" value=\"animacion\" id=\"btn\">");
ventana.document.getElementById("btn").onclick=a(ventana);
}
</script>
</head>
<body>
</body>
</html>```
i have already achieve to open the new window but i cant make it move to the right.