我可以使用以下内容创建一个jquery ui对话框:
$("#dialogs .add_entry").dialog
({
height: 500,
width: 750,
autoOpen: false,
stack: true,
show: "fade",
resizable: true,
title: "Add Entry",
modal: true
});
<div id="dialogs">
<div class="add_entry">Test</div>
</div>
但是当我稍后使用$("#dialogs .add_entry").dialog(" open ");打开对话框时,什么也没有发生(没有js错误)。我认为它与选择器相关,将autoOpen切换为true将显示对话框。有没有人见过这个?
发布于 2012-07-01 15:11:38
$(function(){
$element = $("#dialogs .add_entry");
$element.dialog({
height:500,
width:750,
stack: true,
show: "fade",
resizable: true,
title: "Add Entry",
autoOpen:false,
modal: true
});
$element.dialog("open");
});
如果将其放在元素之前,则可以执行此操作。之后不起作用。也不能使用out变量,没有包装函数也不能工作...这是一个多错的函数。
发布于 2012-07-01 14:59:41
试试这个:
$("#dialogs > .add_entry")
或
$("#dialogs").children(".add_entry")
https://stackoverflow.com/questions/11282976
复制