jquery-ui - Jquery 对话框打开/关闭

标签 jquery-ui modal-dialog jquery-ui-dialog

我正在尝试在 jquery 中创建模型对话框。我想让我的按钮打开对话框。目前,一旦打开它,它也会关闭它。我从来没有告诉它关闭它,但是当我单击按钮时它会打开然后立即关闭。知道为什么吗?

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>

<body>
<form id="form1" runat="server">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://jquery-ui. googlecode.com/svn/tags/latest/external/jquery. bgiframe-2.1.2.js" type="text/javascript"></script>
<script src="http://jquery-ui. googlecode.com/svn/tags/latest/ui/minified/i18n/jquery-ui-i18n.min.js" type="text/javascript"></script>

<asp:Button ID="rejctbutton" runat="server" Text="Reject" />
<div id="rejectiondiv">
<h3>
Reason of Rejection for Insurance Claim
</h3>
<h4>
This will email the borrower the reason for the rejection.
</h4>
<asp:Label ID="rejectLabel" runat="server" Text="Reason"></asp:Label>
<asp:TextBox ID="rejectTB" runat="server"></asp:TextBox>
</div>

<script type="text/javascript">
$("#rejectiondiv").dialog({ autoOpen: false, modal: true })
$("#rejctbutton")
.button()
.click(function () {
$("#rejectiondiv").dialog("open");

});
</script>
</form>
</body>
</html>

最佳答案

尝试 $('#rejectiondiv').dialog('open');

关于jquery-ui - Jquery 对话框打开/关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11297802/

相关文章:

jquery - 更改 JQuery 对话框或 Google map Z 索引

javascript - 对话框中的多重效果显示/隐藏

jquery - Chrome 扩展程序 : Opening Jquery Ui Dialog

css - Jquery 选项卡不显示

ruby-on-rails - 重定向时在 Rails 中呈现 twitter Bootstrap 模式

javascript - css3 animation.css 不适用于自定义模式

javascript - jQuery Dialog 按钮改变颜色内联

jquery - 返回 jQuery Tabs 选项卡中的最后一个垂直位置

javascript - jQuery Widgets 无法在 Ajax 加载的选项卡上运行

html - 纯 CSS 动画模式/灯箱