0

这是我的代码,为什么不能关闭 img 链接?链接是 id="closeme"。它根本不火。

function displayerror(text){        
// Pop up the new error dialog
        var $errors_dialog = $('<div></div>')
        .html('<div class="notice_body"><div class="notice_header"><img src="images/header.gif" width="634" height="37"></div><div class="notice_mid"><div class="notice_left"><img src="images/body_left.gif" width="164" height="167"></div><div class="notice_right">'+text+'</div></div><div class="notice_footer"><a href="#" id="closeme"><img src="images/footer.gif" width="634" height="49"></a></div></div>')
        $errors_dialog.dialog({
            autoOpen: false,
            maxWidth:670,
                    maxHeight: 260,
                        width: 670,
                        modal: true ,
                        height: 500,
                        resizable: false,
                        dialogClass:'transparent',
                        position: ['top', 175],
                        create: function(event, ui) { 
                       $("#closeme").click(function(event) {
                        alert("test");
                            $errors_dialog.dialog('close');
                })}
        });

        $errors_dialog.dialog('open');
        return false;

}

4

1 回答 1

0

在公开声明之前实现了这一点:

        $("#closeme").click(function(){
            $errors_dialog.dialog('close');
        });
于 2013-02-25T21:12:34.263 回答