Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Absolute Positioning with jQuery UI dialogs

I'm using a few jQuery UI modal dialogs and the positioning of each dialog is set to relative by default. This is causing me a few problems and I'd like to know if there's some way I can get the positioning to be 'absolute' by default.

It seems to me that absolute positioning would make more sense in any case.. Is there any reason in particular for the use of relative positioning for dialogs?

Thanks!

like image 586
Rahul Sekhar Avatar asked Mar 28 '12 08:03

Rahul Sekhar


1 Answers

Whoops, I just realised why this was happening - I wasn't using the jQuery UI css files (in which, I assume, the position of the dialog is set to absolute). Since the position wasn't set to absolute, by default jQuery UI used relative positioning.

I merely had to set the position of the dialog to absolute in my own css sheet:

.ui-dialog {
    position:absolute;
}

And my problem is solved.

Silly question, with an obvious answer that I should have tried before I asked it. I'll leave it up here in case someone else happens to run into the same issue though.

like image 188
Rahul Sekhar Avatar answered Sep 22 '22 22:09

Rahul Sekhar