Web Analytics Made Easy -
StatCounter jQuery UI dialog containment to drag inside specific areas - CodingForum

Announcement

Collapse
No announcement yet.

jQuery UI dialog containment to drag inside specific areas

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • jQuery UI dialog containment to drag inside specific areas

    Hello,
    I tried to work with jQuery UI dialog with containment. It actually works.
    This code will enable the user to drag the dialog within the body.
    The second thing I want it to enable modal. I usually do this with:

    Code:
    $(document).ready(function() {
        $("#dialog-modal").dialog({
            width: 500,
            height: 500,
            modal: true,
            autoOpen: false,
            resizable: false,
            open: close,
            close: open
        });
    Here is my jquery code that will enable the containment mode:

    Code:
    $(document).ready(function ()
    {
        $("#dialog").dialog();
        $('.ui-dialog').draggable( "option", "containment", 'body' );  
    });
    Can somebody help me to enable modal true again with containment?

    Thanks a lot,

    grid
    Last edited by grid_; Aug 21, 2011, 07:37 PM.

  • #2
    I got it already working:

    Code:
    $(document).ready(function ()
    {
        $("#dialog").dialog({modal:true});
        $('.ui-dialog').draggable( "option", "containment", 'body' );  
    });
    Thanks,

    grid
    Last edited by grid_; Aug 21, 2011, 07:36 PM.

    Comment

    Working...
    X