zoukankan      html  css  js  c++  java
  • js弹出窗体

    js 弹出窗体语法及参数详解

    js:

        <script type="text/javascript">
            function openEg(url, width, height, left, top) {
                var temp = "channelmode=no,location=no,menubar=no,toolbar=no,directories=no,scrollbars=no,resizable=no";
                if (width) {
                    temp += ',width=' + width;
                } else {
                    width = 0;
                }
                if (height) {
                    temp += ',height=' + height;
                } else {
                    height = 0;
                }
                if (left) {
                    temp += ',left=' + left;
                } else {
                    temp += ',left='
        + Math.round((window.screen.width - parseInt(width)) / 2);
                }
                if (top) {
                    temp += ',top=' + top;
                } else {
                    temp += ',top='
        + Math.round((window.screen.height - parseInt(height)) / 2);
                }
                window.open(url, '_blank', temp);
            }
        </script>

    HTML:

    <div>
            <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="openEg('Default2.aspx',700,600)" />
      </div>

    弹出的窗体left和top不赋值的话,默认居中!

    该方法不支持360!

  • 相关阅读:
    FTP服务
    Samba文件共享服务设置
    Samba
    编译安装-httpd-2.2.15.tar.gz
    分析排查系统故障
    进程--计划任务
    磁盘配额
    LVM卷
    Linux磁盘分区
    用户组权限
  • 原文地址:https://www.cnblogs.com/fuge/p/2607869.html
Copyright © 2011-2022 走看看