繁体   English   中英

打开一个新页面作为模式窗口

[英]Open a new page as modal window

我有以下代码,如果存在行,如何打开其他页面作为模式窗口弹出窗口?

 function editLesson(){
            var row = $('#dg').datagrid('getSelected');
            if (row){
             // would like to open another page as modal window

            }
        }

任何帮助都是非常明显的。

您可以使用fancybox插件。 这是一个非常不错的插件。 http://fancybox.net/ (注意fancybox 2也已退出)

http://jsfiddle.net/kasperfish/5EV8r/109/

$.fancybox('hello');

您还可以在fancybox(模式)窗口中加载iframe http://jsfiddle.net/kasperfish/5EV8r/110/

    $.fancybox([
        'url'//url to your page
    ], {

        'padding'           : 10,
        'type'              : 'iframe',//set type to iframe
        'overlayOpacity'    : 0.7,
        'overlayColor'      : 'black',
        'speedIn'           : 900,
        'speedOut'          : 400,
        'width'             : '70%',
        'height'            : '50%'

    });

您可以使用JQuery对话框

如此处所述:

   <!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>jQuery UI Dialog - Default functionality</title>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css" />
  <script>
  $(function() {
    $( "#dialog" ).dialog();
  });
  </script>
</head>
<body>

<div id="dialog" title="Basic dialog">
  <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>


</body>
</html>

http://jqueryui.com/dialog/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM