Re: Customise preview window height and width

  •  08-23-2013, 1:33 PM

    Re: Customise preview window height and width

    Hi rezagc,

     

    You can change the editor height dynamically when the user switch to preview. The example below shows you how to achieve it.

     

    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    4. <html>  
    5. <head>  
    6.     <title>example </title>  
    7. </head>  
    8. <body>  
    9.     <form id="Form1" runat="server">  
    10.         <CE:Editor ID="Editor1" runat="server" Height="500">  
    11.         </CE:Editor>  
    12.     </form>  
    13. </body>  
    14. </html>  
    15.   
    16. <script>  
    17. function changeHeight(custom_height)  
    18. {  
    19.     var editor1=document.getElementById("<%= Editor1.ClientID %>");  
    20.     editor1.SetHeight(custom_height);  
    21. }  
    22. function CuteEditor_OnCommand(editor,command,ui,value)  
    23.  {  
    24.     if(command=="TabView")  
    25.     {  
    26.         setTimeout("changeHeight(650)",200);  
    27.     }  
    28.     if(command=="TabCode"||command=="TabEdit")  
    29.     {  
    30.         setTimeout("changeHeight(500)",200);  
    31.     }  
    32. }  
    33. </script>  
     

    Regards,

     

    Ken 

View Complete Thread