Re: Any way to suppress the scroll bars in the Editor?

  •  07-12-2010, 8:34 PM

    Re: Any way to suppress the scroll bars in the Editor?

    Hi Richard Schaefer,
     
    In method "CuteEditor_OnInitialized", editor will as a parameter. You can use it directly.
     
    Below it an example to show you how to switche the scroll bar state between on and off.
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>   
    4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    5. <html xmlns="http://www.w3.org/1999/xhtml">   
    6. <head id="Head1" runat="server">   
    7.     <title>Untitled Page</title>   
    8. </head>   
    9. <body>   
    10.     <form id="form1" runat="server">   
    11.         <CE:Editor ID="editor1" runat="server">   
    12.         </CE:Editor>   
    13.         <input type="button" value="scroll on" onclick="scrollOn()" />   
    14.         <input type="button" value="scroll off" onclick="scrollOff()" />   
    15.     </form>   
    16. </body>   
    17. </html>   
    18.   
    19. <script>      
    20. function CuteEditor_OnInitialized(editor)      
    21. {      
    22.     var editdoc = editor.GetDocument();      
    23.     //editdoc.body.scroll="no"; firefox does not support scroll      
    24.     editdoc.body.style.overflow="hidden";      
    25. }      
    26. function scrollOn()   
    27. {   
    28.     var editor1 = document.getElementById("<%= editor1.ClientID %>");   
    29.     var editdoc = editor1.GetDocument();    
    30.     editdoc.body.style.overflow="";    
    31. }   
    32. function scrollOff()   
    33. {   
    34.     var editor1 = document.getElementById("<%= editor1.ClientID %>");   
    35.     var editdoc = editor1.GetDocument();    
    36.     editdoc.body.style.overflow="hidden";    
    37. }   
    38. </script>  

    Regards,
     
    Ken
View Complete Thread