如何处理在javascript上打开的窗口上的事件

我正在尝试创建一个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.
tianyacnbeta 回答:如何处理在javascript上打开的窗口上的事件

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3113739.html

大家都在问