• 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>

  • 相关阅读:
    cancel-ng-swipe-right-on-child
    css.day.05.eg
    css.day05
    css.day04.eg
    css.day04
    css.day03.eg
    css.day03
    css.day02.eg
    九月十月百度人搜,阿里巴巴,腾讯华为笔试面试八十题(第331-410题)(转)
    阿里巴巴笔试题选解
  • 原文地址:https://www.cnblogs.com/louby/p/5637928.html
Copyright © 2020-2023  润新知