I’ve got a main content div, and I’d like to centre the dialog to that div, rather than to the page. Any ideas? I know there’s a position utility, but I can’t work out how to use it with the dialog position options.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re correct,
.position()is the way to go here, like this:
In the above
#parentit the parent element selector, you can give it a try here. You want themyandatproperties to becenterso they’re centered op top of one another, then theofselector is the parent selector you want it centered in.I specified all relevant options for illustration, but since
centeris the default formyandat, you can specify just theoflike I have in the commented line above.