zoukankan      html  css  js  c++  java
  • js window.open 打开新窗体 参数设置

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
        <title>无标题文档</title>
    </head>

    <form>
        <input type="button" name="Button1" value="CN-Bruce" onclick="WinOpen()" />

        <button onclick="window.open('http://www.aspxhome', '', 'width=800,height=300')">open1</button>

        <button onclick="var newwin = window.open('http://www.aspxhome', '', 'width=800,height=300'); newwin.moveTo(50, 50), newwin.resizeTo(800, 300)">open2</button>
        <button onclick="window.showModelessDialog('http://www.aspxhome', '', 'dialogWidth:800px;dialogHeight:300px')">open3</button>
        <a href="#" onclick="window.open('http://www.aspxhome','target','param')">a11</a>
    </form>
    <body>
    </body>
    </html>

      <!--window.open 参考文档:http://www.cnblogs.com/mfryf/archive/2013/06/10/3130286.html-->

    <script language="JavaScript">

        
        function WinOpen() {
            //得到页面高度
            var yScroll = (document.documentElement.scrollHeight > document.documentElement.clientHeight) ? document.documentElement.scrollHeight : document.documentElement.clientHeight;

            //self.resizeBy = yScroll;
            //得到页面宽度
            var xScroll = (document.documentElement.scrollWidth > document.documentElement.clientWidth) ? document.documentElement.scrollWidth : document.documentElement.scrollWidth;

            //self.resizeTo(xScroll - 200, yScroll - 200);

            //self.moveTo(xScroll - 200, yScroll - 200);
            var x = xScroll - 200;
            var y = yScroll - 100;

            //mesg = open("http://www.aspxhome", "DisplayWindow", "toolbar=no,,menubar=no,location=no,scrollbars=no");
            //mesg.document.write("<HEAD><TITLE>中国asp之家</TITLE></HEAD>");
            //mesg.document.write("<CENTER>http://www.aspxhome</CENTER>");
            //window.open('http://www.aspxhome', '', 'width="' + x + 'px",height="' + y + '"px');

            var featrures = "toolbar=no,menubar=no,location=no,scrollbars=yes,";
            var newwin = window.open('http://www.aspxhome', 'target', featrures);
            newwin.resizable = "yes";
            newwin.moveTo(100, 10);
            newwin.moveBy(100, 80);
            
            top = 200
            //       newwin.resizeTo(x, y);
        }
        //得到页面高度
        var yScroll = (document.documentElement.scrollHeight > document.documentElement.clientHeight) ? document.documentElement.scrollHeight : document.documentElement.clientHeight;

        //self.resizeBy = yScroll;
        //得到页面宽度
        var xScroll = (document.documentElement.scrollWidth > document.documentElement.clientWidth) ? document.documentElement.scrollWidth : document.documentElement.scrollWidth;

        //self.resizeTo(xScroll - 200, yScroll - 200);

        //self.moveTo(xScroll - 200, yScroll - 200);

    </script>

  • 相关阅读:
    Python单元测试之unittest基础
    linux--硬链接和软链接
    12-8 istio核心功能实战-----可观察性(程访问遥测插件)
    12-7 istio核心功能实战-----可观察性(网络可视化)
    12-6 istio核心功能实战-----可观察性(分布式追踪)
    12-3 部署面向生产的istio-----核心组件
    12 ServiceMesh代表作istio-----12-1 ServiceMes、Istio架构原理
    11-7 Grafana看板和邮件报警
    11-6 监控落地
    11-4 部署前奏-Helm&Operator
  • 原文地址:https://www.cnblogs.com/louby/p/5637928.html
Copyright © 2011-2022 走看看