How to make elements float outside jQuery dialogs

I want to have a dialog similar to this:

Dialog with items floating outside

I thought this approach would work, but I think I was wrong:

Javascript

//Creates The Dialog
$('.ImageDialogDiv').dialog({
    position: [98, 223],
    resizable: false,
    //modal: true,   /* UNCOMMENT AFTER DEBUGGING */
    closeOnEscape: false,
    class: 'OverwriteDialogOverflow',
    title: $('#hiddenDialogElements').html(),
    open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); }
});

CSS

  /*
  * Overrides hidden overflow
  */
 .OverwriteDialogOverflow
 {
     overflow: visible;
 } 

HTML

<div id = "dialogDiv" class = "ImageDialogDiv"></div>

<div id = "hiddenDialogElements">
    <button id = "hiddencloseButton">Close</button>
    <div id = "hiddenArrowButtons">
        <button class = "ArrowButtonDialogLeft" onclick = "ShowNextImage(-1)" ></button>
        <button class = "ArrowButtonDialogRight" onclick = "ShowNextImage(1)" ></button>
    </div>
</div>

When I try to move the arrows or close the button in the dialog box, turn it off and you won’t see it. I would say that the addition .OverwriteDialogOverflowwill take care of this.

Suggestions?

+3
source share
2 answers

I will edit this with more details if / when you update the message, but I would put the dialog box and buttons in the div div with relative positioning and use absolute positioning to place the buttons. Something like below ...

HTML:          

    <div id = "hiddenDialogElements">
        <button id = "hiddencloseButton">Close</button>
        <div id = "hiddenArrowButtons">
            <button class = "ArrowButtonDialogLeft" onclick = "ShowNextImage(-1)" ></button>
            <button class = "ArrowButtonDialogRight" onclick = "ShowNextImage(1)" ></button>
        </div>
    </div>
</div>

CSS

.OverwriteDialogOverflow { overflow: visible; }

#dialogContainer { position: relative; }

#hiddencloseButton {
    position: absolute;
    top: -15px;
    right: -15px;
}

#hiddenArrowButtons {
    position: absolute;
    bottom: -30px;
}

.ui-dialog { overflow: visible; }

: .ui-dialog CSS

+1

,

                $(".ui-dialog-titlebar-close").css('background-image', 'url(../../images/closePopUpX.png)');
                $(".ui-dialog-titlebar-close").css('width','25');
                $(".ui-dialog-titlebar-close").css('height','25');
                $(".ui-dialog-titlebar-close").css('top','-7px');
                $(".ui-dialog-titlebar-close").css('right','-15px');
                $(".ui-dialog-titlebar-close").css('background-repeat','no-repeat');
                $(".ui-dialog-titlebar-close").css('background-position','center center');
                $(".ui-dialog").css('overflow','visible');
                $('.ui-icon').css('display','none');

.

0

All Articles