I need to center a modal dialog when is displayed and when windows is resized.
How can I achieve that?
center a modal dialog on resize
I got some css
.ui-dialog {
width: 50%;
position: fixed;
top: 50%;
left: 50%;
transform: translate(50%, -50%);
}
which does the trick but somehow when the window is resized, the dialog moves to the right side and stays there rather than staying on the center.
.ui-dialog {
width: 50%;
position: fixed;
top: 50%;
left: 50%;
transform: translate(50%, -50%);
}
which does the trick but somehow when the window is resized, the dialog moves to the right side and stays there rather than staying on the center.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 20 guests