This is a migrated thread and some comments may be shown as answers.

[Solved] Window Doesn't Center

1 Answer 201 Views
Window
This is a migrated thread and some comments may be shown as answers.
Italo
Top achievements
Rank 1
Italo asked on 15 Nov 2007, 07:56 PM
Window Doesn't Center When the DOCTYPE is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

I was able to bypass this with the script below.

var nWidth = document.body.offsetWidth / 2 - oWnd.get_Width() / 2;

var nHeight = document.body.offsetHeight / 2 - oWnd.get_Height() / 2;

oWnd.moveTo( nWidth + "px", nHeight + "px" );



Thanks,
Italo

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 16 Nov 2007, 01:11 PM
Hi Italo,

Thank you for sharing your approach with the community.
Generally speaking, the problems that you experience with centering the RadWindow in such scenario (HTML DOCTYPE) comes from the ASP.NET AJAX environment which is designed to work with XHTML DOCTYPE. Accordingly all RadControls "Prometheus" which are built upon ASP.NET AJAX are designed to work with it.

Please note however that your code will work as expected under IE7 only - you will need to add support for Mozilla as well in order to provide the same result there. We will also try to add some improvements for HTML DOCTYPE scenarios from our side.




Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
Italo
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or