想要通过javascript显示依赖的弹出窗口,这也适用于IE7及以上

本文关键字:适用于 IE7 窗口 javascript 显示 依赖 | 更新日期: 2023-09-27 17:53:03

我想通过javascript函数显示一个弹出窗口,具有以下条件--弹出窗口应该在页面的中心。-当弹出窗口打开时,用户无法访问父页面。-也可在IE7或以上版本使用

然而,我正在尝试以下代码,但没有成功。

 window.open('PopUp.aspx', 'popjack',
        'toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=no,scrollbars=no,width=955,height=500');

可以很容易地通过jQuery吗?提前感谢。

想要通过javascript显示依赖的弹出窗口,这也适用于IE7及以上

来自jQuery UI文档

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>jQuery UI Dialog - Basic modal</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
  <script src="/resources/demos/external/jquery.bgiframe-2.1.2.js"></script>
  <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css" />
  <script>
  $(function() {
    $( "#dialog-modal" ).dialog({
      height: 140,
      modal: true
    });
  });
  </script>
</head>
<body>
<div id="dialog-modal" title="Basic modal dialog">
  <p>Adding the modal overlay screen makes the dialog look more prominent because it dims out the page content.</p>
</div>
<p>Sed vel diam id libero <a href="http://example.com">rutrum convallis</a>. Donec aliquet leo vel magna. Phasellus rhoncus faucibus ante. Etiam bibendum, enim faucibus aliquet rhoncus, arcu felis ultricies neque, sit amet auctor elit eros a lectus.</p>

</body>
</html>

对话框现在应该打开到窗口的中心,它应该是模态的(用户不能与对话框以外的元素交互)