views:

93

answers:

1

Is there an trick to make a jquery dialog be draggable at any point? (i mean not only in the title bar)

+1  A: 

As opposed to a sortable item, dialog items doesn't have that functionality (I'm not sure why). If needed, you might be able to do something like this:

$(document).ready(function() {
    var
        // Create dialog
        dialog = $('div')
            .dialog({ title: "I'm a dialog" })
            .css({cursor: 'move'}),

        // Get the options manually
        options = dialog
            .data("dialog")
                .uiDialog
                .data('draggable')
                    .options;

    // Finally, extend the draggable modal box's
    // options and remove any restrictions
    $.extend(options, {cancel: '', handle: ''});
});

See a working example here: http://jsfiddle.net/gMP2d/

peol
good one, thanks
albanx