我喜欢有一个带有外部 url 链接的对话框模式,并且允许在对话框内部保存而不关闭对话框。我不确定这是最好的方法,但至少当按钮保存对话框模式不关闭时。因此,为了让我在不关闭对话框的情况下单击模态弹出窗口中的保存按钮,我与 Iframe 一起使用,但有两个问题:
- 如果没有
//dialog.load(url);
运行,css 是不同的
- iframe 无法自动调整大小。
那么有人对此有解决方案吗?
$('.popupEdit').click(function () {
var url = this.href;
var dialog = $('<div id="pEdit"><iframe id="iframedit" src="' + url + '" style="width:1200px;height:490px;" frameborder="0" ></iframe></div>').appendTo('body');
//var dialog = $('<iframe src="' + url + '" style="width:1200px;height:490px;"></iframe>').appendTo('body');
//dialog.load(url);
dialog.dialog({
autoResize: true,
height: 'auto',
width: 'auto',
modal: true,
position: 'center',
draggable: true,
open: function (type, data) { $(this).parent().appendTo("form"); },
close: function (type, data) { $("[id$=btnSearch]").click(); }
});
最佳答案
可能是这个替代方案可以为您提供要求:
您可以在 http://www.scriptiny.com/2009/05/javascript-popup-box/ 使用 TinyBox 弹出窗口
使用 iframe
选项。
具有与您提到的相同的功能......
关于带有 ASP.net 回发的 Jquery 对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10296990/