Open / close jquery dialog using wrapping effect

I want to close this dialog box and pass it to an object

I tried using this ... not luck

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

Now I'm doing it ... still no luck

$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" );
+5
source share
1 answer

This working jsFiddle demo should be what you need:

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();

            });

    }

});
+3
source

All Articles