⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex10-5.htm

📁 《JAVASCRIPT 动态网页编程实例手册》一书中的源代码
💻 HTM
字号:
    <html><head><title>窗口移动演示 </title>
    <script language="JavaScript">
    <!-- 
        function simpleMove(){
           winObj=window.open("ex10-5-poem.htm","poem",
              "width=260,height=500,resizable=no");
           winObj.moveTo(0, 0); //将新打开的窗口移动到左上角
           winObj.focus();
           parent.window.moveTo(275, 0);  // 移动父窗口的位置
           parent.window.resizeTo(480,430);   // 改变父窗口的大小
        }
        function closeWindow(){
           winObj.close();
        }
    //  -->
    </script>
    </head>
    <body bgColor="lightblue">
    <h2>新建窗口和原窗口的移动</h2>
    要新建一个窗口并移动其位置,
    <br>
    请单击下面的按钮:
    <form >
       <input type="button"
          value="移动窗口"
          onClick="simpleMove();">
    <p>当你想关闭新建窗口时,请单击下面的链接: <br>
    <a href="javascript:closeWindow()">关闭新打开的窗口 </a></h3>
    </body>
    </html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -