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>

  • 相关阅读:
    linux修改hostname
    ssh免密登录
    Linux添加用户到sudoers组
    nginx.conf
    linux ( CentOS 7)下Tengine(nginx)的安装与配置
    jacoco + ant远程统计(tomcat/spring boot)服务的代码覆盖率
    我只为一瓶啤酒
    iptables学习笔记
    离开了南京,从此没有人说话
    AutoConf自动生成Makefile(基于helloworld简单例子)
  • 原文地址:https://www.cnblogs.com/louby/p/5637928.html
Copyright © 2011-2022 走看看