`
wlh269
  • 浏览: 462790 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

openwindow 居中

阅读更多
function openWin(u, w, h) {
            var l = (screen.width - w) / 2;
            var t = (screen.height - h) / 2;
            var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l;
            s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no';
            open(u, 'oWin', s);
      }

分享到:
评论

相关推荐

    window.open()弹出居中的窗口

    ### window.open()弹出居中的窗口 在前端开发过程中,我们常常需要利用JavaScript来实现一些交互功能,其中弹窗操作是非常常见的一种需求。通过`window.open()`方法可以创建一个新的浏览器窗口,而要使得这个新窗口...

    js让弹出新窗口居中显示的脚本

    在打开新窗口的时候,很多时候开发者希望这个新窗口能够自动居中显示在用户的屏幕上,以提升用户体验。在本篇文章中,我们将探讨如何使用JavaScript脚本来实现这个需求。 首先,需要注意的是,这个功能并不是所有的...

    window.open打开页面居中显示的示例代码

    在本例中,我们将深入探讨如何使用 `window.open()` 实现页面居中显示的功能。 首先,让我们来分析给出的 `1.js` 代码: ```javascript function openwindow(url, name, iWidth, iHeight) { // url 转向网页的...

    Javascript中封装window.open解决不兼容问题

    function openWindow(url, options) { var str = ""; // 初始化选项字符串 // 如果提供了选项对象 if (options) { // 设置默认高度和宽度 options.height = options.height || 420; options.width = options....

    网页设计弹出窗口大全(js)

    private void OpenWindow(string mode) { string script = "<script type=\"text/javascript\">"; script += "var height = (screen.availHeight - 530) / 2;"; script += "var width = (screen.availWidth - 600...

    两个JS文档

    在JavaScript中,`openWindow`函数是用于创建并打开一个新的浏览器窗口。这个函数接受五个参数: 1. `f`: 链接地址,即新窗口要加载的网页URL。 2. `n`: 窗口的名称,可以用来标识或重用已存在的窗口。 3. `w`: 窗口...

    弹出窗口大全(js)

    该函数用于打开具有指定宽度和高度的窗口,并且可以调整窗口的位置,使其居中显示。 代码实现如下: ```javascript function g_OpenSizeWindow(pageURL, innerWidth, innerHeight) { var screenWidth = screen....

Global site tag (gtag.js) - Google Analytics