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 对话框模式?
基础教程推荐
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
