jquery对话框使用传输效果打开/关闭

时间:2011-05-12 18:40:32

标签: jquery-ui

我希望能够关闭此对话框并将其传输到对象

我试过用这个......不幸运

close: function() {
    $(this).effect( 'transfer', { to: "#smpb_info_btn", className: "ui-effects-transfer" }, 500 );$(this).remove();
}

现在我正在努力......仍然没有运气

$PMinfo_Dialog.dialog({
        autoOpen: true,
        height: 250,
        width: 600,
        modal: false,
        draggable: false,
        resizable: false,
        hide:{
             effect:"transfer",
             options:{from: "#smpb_info_btn", className: "ui-effects-transfer"},
             speed:500
             } ,

        close: function() { $(this).remove();},
        });
    $PMinfo_Dialog.dialog( "open" );

1 个答案:

答案 0 :(得分:3)

working jsFiddle demo 应该是您所需要的:

<强> HTML:

<div id="PMinfo">Hello</div>

<button id="smpb_info_btn">Info</button>

<强> CSS:

.ui-effects-transfer { border: 2px dotted gray; } 

<强> JS:

$("#PMinfo").dialog({

    autoOpen: true,
    height: 250,
    width: 600,
    modal: false,
    draggable: false,
    resizable: false,
    beforeClose: function() {

        var $this = $(this);

        $this
            .dialog("widget")
            .effect("transfer", {

                to: "#smpb_info_btn",
                className: "ui-effects-transfer"

            }, 500, function() {

                $this.remove();

            });

    }

});