0

我打开了一个对话框将照片设置为个人头像图片,...单击后如何关闭对话框?提前致谢,...

<script type="text/javascript">
$(document).ready(function() {
    $('#profile_picture_dialog_<?php echo $profile['User']['id'] ?> a').each(function() {
        var $link = $(this);
        var $dialog = $('<div></div>')
            .load($link.attr('href'))
            .dialog({
            autoOpen: false,
            width: 500,
            modal: true,
            title: 'Set Profile Picture'
            });

        $link.click(function() {
            $dialog.dialog('open');

            return false;
        });
    });
});
</script>

这是对话框内容:(推测)

  a href="/photos/ajax_set_buddy/148" Photo Image Here "/a"
4

1 回答 1

0

尝试这个:

   $link.click(function() {
        $dialog.dialog('open');

        $("#the-element-you-want-me-to-click").one("click", function() {
            $dialog.dialog('close');
        });

        return false;
    });
于 2013-04-26T20:45:38.197 回答