SP.UI.ModalDialog.showModalDialog not in the center of the page.
Hi, I use SP.UI.ModalDialog.showModalDialog with size (w, h), but no position (x,y) set. If I'm not scroll up/down, the pop-up will be in the center of the page. If I scroll up/down, the box will show at the top of the page. All documents I found said without any setting (x,y) modal box will show in the center. There is something wrong. Any suggestion will be appreciate. Thanks, Jump
January 8th, 2011 1:30pm

I didnt tried this method.For some requiremt i have used light box pop up.It is good method of generating pop up http://gettopup.com/examplesDestin -MCPD: SharePoint Developer 2010, MCTS:SharePoint 2007 Application Development
Free Windows Admin Tool Kit Click here and download it now
January 9th, 2011 7:59am

Thanks Destin, I will try this solution if there is no way to fix SP.UI.ModalDialog.showModalDialog. At this point, there are so many places to be updated. Thanks again Destin, Jump
January 9th, 2011 1:41pm

Hi, Jump Would you please let us know how is your problem going? Was Destin Joy’s suggestion helpful on your issue? If you need further assistance, please feel free to let us know. Have a nice day! Best Regards, Aaron TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com
Free Windows Admin Tool Kit Click here and download it now
January 24th, 2011 8:20am

Dear Jump, I believe some of your <div> present inside your page has a style set with 'Position:absolute' if found please replace it with relative and it may be the problem since the SP.UI.ModalDialog itself is not a new window instead its a div layer a block-level element that is used to divide the page into logical sections, and can hold whatever you need inside it. I had a similar problem and I had fixed it from my master page. Moreover the SP.UI.ModalDialog has DialogOptions with X and Y properties where X Specifies the starting position of the rendered dialog. If this value is not set the dialog is shown in the middle of the viewing area. This value represents the offset from the left edge of the parent browser window and Y specifies the starting position of the rendered dialog. If this value is not set the dialog is shown in the middle of the viewing area. This value represents the offset from the bottom of the parent browser window. Regards, Udai.m
February 14th, 2011 1:07pm

I have a Blog entry with a jQuery script to auto-center the ModalDialog here: http://generation12.wordpress.com/2011/10/25/floating-the-sp-ui-modaldialog/ Russ Ramirez
Free Windows Admin Tool Kit Click here and download it now
October 28th, 2011 11:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics