How to center a window in the fixed position?
The RadWindow should remains on the centre of browser window during page scrolling.
2 Answers, 1 is accepted
0
Martin
Telerik team
answered on 15 Dec 2009, 08:05 AM
Hi Ivan Petrov,
What you need can easily be accomplished with a two CSS selectors applied to the wrapping element of RadWindow:
<style type="text/css">
.RadWindow
{
position: fixed !important; /* all browsers in standards-compliance mode */
}
* html div.RadWindow
{
position: absolute !important; /* IE6 and IE7/8 in quirks mode */
}
</style>
Please, keep in mind that Internet Explorer 6 does not support CSS position: fixed (and more - if your page is non-xhtml, this will not work in IE7 and IE8 as well), so the code above will be ignored by that particular version and the rendering will be handled by the second selector (the one with the * html hack). Also - make sure you do not remove the !important flag at the end of the property value, because otherwise you will not be able to force your custom setting, and the window will persist its absolute position instead of getting fixed.
But, unfortunately, it have problem.
If to scroll down browser window (RadWindow stay in fixed position), and then to try drag-and-drop a RadWindow ...
If document.body.scrollTop is more than zero, RadWindow drag-and-drop works incorrectly (with css style - position: fixed).