How to make jQuery dialog modal?(如何制作 jQuery 对话框模式?)
问题描述
我在 asp.net 中使用 jQuery 对话框.它对我来说很好.问题是当我打开对话框时,我仍然可以使用父页面功能.我不想要那个.只是对话框到模态,不应该让焦点在父页面上.
I am using jQuery dialog in asp.net. It is working fine for me. The problem is when I open the dialog box, I can still work parent page functionality. I don't want that. Just dialog to modal and should not allow focus on parent page.
window.onload = function onloadFunction() {
//setup edit person dialog
$('#uploadPic').dialog({
autoOpen: false,
draggable: true,
title: "Upload Picture",
open: function(type, data) {
$(this).parent().appendTo("form");
}
});
}
有没有办法让它成为模态的?或者如果失去焦点自动关闭对话框?
Is there any way to make it modal? Or if lost focus on dialog box close it automatically?
请帮帮我.
推荐答案
使用
$('#uploadPic').dialog({
autoOpen: false,
modal: true,
draggable: true,
title: "Upload Picture",
open: function(type, data) {
$(this).parent().appendTo("form");
}
});
}
我刚刚将模态选项添加到您的示例中.
I have just added the modal option to your sample.
这篇关于如何制作 jQuery 对话框模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何制作 jQuery 对话框模式?


基础教程推荐
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 如果条件可以为空 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- 将数据集转换为列表 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01