JavaScript -- Window-Move,Print

本文介绍了一个使用JavaScript创建新浏览器窗口的方法,并展示了如何通过编写脚本实现新窗口的位置移动功能,包括相对移动和绝对定位。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

-----035-Window-Move.html-----

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4     <meta http-equiv="content-type" content="text/html; charset=utf-8">
 5     <title>标题</title>
 6 </head>
 7 <body>
 8 <script type="text/javascript">
 9     function openNew()
10     {
11         wnd = window.open("", "", "width=200 height=160 location=no");
12         wnd.document.write("新窗口");
13         wnd.document.write("<center><button onclick='moveBy(100, 100)'>移动(100, 100)</button></center><center><button onclick='moveTo(100, 100)'>移动到(100, 100)</button></center>");
14     }
15 </script>
16 <h1>创建新窗口</h1>
17 <button onclick="openNew()">创建新窗口</button>
18 <button onclick="print()">打印窗口</button>
19 </body>
20 </html>

转载于:https://www.cnblogs.com/baijifeilong/p/3728109.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值