-4
有人可以帮我设置jQuery UI对话框自动打开吗?谢谢。我当前的代码:jQuery UI自动打开
<script type="text/javascript">
function openDialog(url) {
$("<div class='popupDialog'>Loading...</div>")
.dialog({
autoOpen: true,
closeOnEscape: true,
width: 'auto',
height: 'auto',
modal: true,
beforeClose: function(){ $(this).remove(); }
}).bind('dialogclose', function() {
jdialog.dialog('destroy');
}).load(url, function() {
$(this).dialog("option", "position", ['center', 'center']);
$(this).dialog("open");
});
}
$(window).resize(function() {
$(".ui-dialog-content").dialog("option", "position", ['center', 'center']);
});
</script>
有什么理由不与您现有的代码的工作?我可以猜测你的对话框没有打开,但它可能是别的。检查您的浏览器的控制台是否有任何代码错误。 – Bojangles 2012-02-06 20:42:22