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

Make the radwindow to float in ie 6

1 Answer 50 Views
Window
This is a migrated thread and some comments may be shown as answers.
saravanan k
Top achievements
Rank 1
saravanan k asked on 05 Jul 2010, 06:56 AM
Hi,

        I am using a radwindow with modal background. I have a requirement to make the window float when the page is scrolled. I referred the scripts from this link,
http://www.telerik.com/community/code-library/aspnet-ajax/window/floating-r-a-d-window-on-page-scroll-window-stays-visible-during-scrolling.aspx
Find below the style and scripts,

<head runat="server"
    <title>Untitled Page</title> 
    <style type="text/css"
    html, body, form 
    { 
      padding: 0px; 
      margin: 0px; 
      height: 100%; 
      width: 100%; 
    } 
     
    .RadWindow 
    { 
        position: fixed !important; 
 
    } 
    </style> 
</head> 
<script type="text/javascript"
            function GetSelectedWindow() 
            { 
                var oManager = GetRadWindowManager(); 
                return oManager.getActiveWindow();       
            } 
             
            function PositionWindow ()  
            { 
           
                var oWindow = GetSelectedWindow();   
                if (!oWindow) { 
                    return
                } 
                 
                var Y = document.body.clientHeight +  
                        document.body.scrollTop -  
                        oWindow.get_height(); 
                 
                var X = document.body.clientWidth +  
                        document.body.scrollLeft -  
                        oWindow.get_width(); 
 
                Y = (Y > 0) ? Y : 0; 
                X = (X > 0) ? X : 0;                     
                oWindow.moveTo(X, Y); 
            } 
 
            function InitWindow ()  
            { 
                setTimeout(function() 
                { 
                    var oWindow = GetRadWindowManager().getActiveWindow();   
                    if (!oWindow)  
                    { 
                        window.setTimeout('InitWindow()', 500); 
                    } 
 
               PositionWindow();}, 0); 
            } 

But the script is not working only in IE 6. This problem is because of the css property position : fixed. But when i tried removing, the scripts are not working. Please help with the code changes to make it work on all browsers including IE 6 mainly.

Regards,
Saravanan K
 

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 06 Jul 2010, 09:21 AM
Hi saravanan k,

I already answered your other thread and for your convenience and for others who might have the same question I pasted my reply below:

You can use the $telerik library to check out whether the browser is IE6 and if so - not execute your script, e.g as shown below:

Copy Code
if($telerik.isIE6)
{
   //custom code for IE6
}
else
{
   //custom code for all other browsres
}

On a side note, I also recommend to examine the behavior of a pinned RadWindow. You can for example open the RadWindow and click on the PinOn button on the titlebar in the demo below and to see how it acts when the page is being scrolled:

http://demos.telerik.com/aspnet-ajax/window/examples/radopen/defaultcs.aspx

If this is the behavior you need, I suggest to use this built-in functionality instead /you can either pin the RadWindow on the client by using the togglePin method or use the InitialBehavior property if you do not want the user to be oblidged to clcik on the button and you can also hide the button/. This functionality is cross browser, easy to use and integrated well in the RadWindow.


Kind regards,
Svetlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
saravanan k
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or