无法关闭jQuery UI对话框
以下是用于打开/关闭对话框和HTML链接的代码的jquery:无法关闭jQuery UI对话框,jquery,jquery-ui,jquery-ui-dialog,Jquery,Jquery Ui,Jquery Ui Dialog,以下是用于打开/关闭对话框和HTML链接的代码的jquery: $("#security-code-link").click(function() { $("#security-code-box").dialog({ draggable: false, height: 500, modal: true, position: ["center","center"], resizable: false,
$("#security-code-link").click(function() {
$("#security-code-box").dialog({
draggable: false,
height: 500,
modal: true,
position: ["center","center"],
resizable: false,
width: 500
});
});
$("#close-security-code-link").click(function() {
$("#security-code-box").dialog("close");
});
<a id="security-code-link">Where is this?</a>
<div id="security-code-box">
<h3>Where is my security code?</h3>
<div class="center">
<img src="<?php bloginfo("template_directory"); ?>/images/security-codes.jpg" />
<br /><a id="close-security-code-link">Close this box</a>
</div>
</div>
$(“#安全代码链接”)。单击(函数(){
$(“#安全代码框”)。对话框({
可拖动:错误,
身高:500,
莫代尔:是的,
位置:[“中心”,“中心”],
可调整大小:false,
宽度:500
});
});
$(“#关闭安全代码链接”)。单击(函数(){
$(“#安全代码框”)。对话框(“关闭”);
});
这是哪里?
我的安全代码在哪里?
/图像/安全代码。jpg“/>
关闭此框
为什么对话框没有关闭?尝试以下操作:
$(function () {
$("#security-code-box").dialog({
draggable: false,
height: 500,
modal: true,
position: ["center","center"],
resizable: false,
width: 500,
autoOpen: false
});
$("#security-code-link").live('click', function() {
$("#security-code-box").dialog('open');
});
$("#close-security-code-link").live('click', function() {
$("#security-code-box").dialog("close");
});
});
为我工作:
确保您的脚本在就绪功能中。它对我有效:使用ff4,您使用的是什么浏览器?