我尝试了各种描述“dialog-1”的方法,但没有成功。如果从那里调用对话框函数,则相同的代码作为页面主体的一部分可以正常工作。相同的代码在表单内部不起作用。
感谢您的帮助。
此函数可以很好地显示对话框。
function helpSThtml () {
$(function() {
$( "<div id='dialog-1' title='Dialog Title goes here...'>This my first jQuery UI Dialog!</div>" ).dialog({
height: 140,
modal: true,
open: function (event, ui) {
$('.ui-dialog').css('z-index',950);
$('.ui-widget-overlay').css('z-index',949);
},
});
});
}
这个函数似乎什么也没做。
function helpSTvar () {
$(function() {
$( "#dialog-1" ).dialog({
height: 140,
modal: true,
open: function (event, ui) {
$('.ui-dialog').css('z-index',950);
$('.ui-widget-overlay').css('z-index',949);
},
});
});
}
</script>
<div id="dialog-1" title="Dialog Title goes here...">This my first jQuery UI Dialog!</div>
</head>
最佳答案
看起来div标签在标题部分,它应该在正文中
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="dialog-1" title="Dialog Title goes here...">This my first
jQuery UI Dialog!</div>
</body>
</html>
关于javascript - 除非将 html 直接输入到对话框函数中,否则无法从 jqgrid 编辑表单内部打开对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33309162/