Hi Richard Schaefer,
Below is the server side example
- <%@ Page Language="C#" %>
-
- <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
- <script runat="server">
- protected void show_Click(object sender, EventArgs e)
- {
-
- state.Value = "on";
- }
-
- protected void hide_Click(object sender, EventArgs e)
- {
-
- state.Value = "off";
- }
-
- </script>
-
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head id="Head1" runat="server">
- <title>Untitled Page</title>
- </head>
- <body>
- <form id="form1" runat="server">
- <asp:HiddenField ID="state" runat="server" />
- <CE:Editor ID="editor1" runat="server">
- </CE:Editor>
- <asp:Button ID="show" runat="server" Text="show scroll bar" OnClick="show_Click" />
- <asp:Button ID="hide" runat="server" Text="hide scroll bar" OnClick="hide_Click" />
- </form>
- </body>
- </html>
-
- <script>
- function CuteEditor_OnInitialized(editor)
- {
- var state=document.getElementById("<%= state.ClientID %>");
- switch(state.value)
- {
- case "":
- scrollOff();
- break;
- case "on":
- scrollOn();
- break;
- case "off":
- scrollOff();
- break;
- }
-
- }
- function scrollOn()
- {
- var editor1 = document.getElementById("<%= editor1.ClientID %>");
- var editdoc = editor1.GetDocument();
- editdoc.body.style.overflow="";
- }
- function scrollOff()
- {
- var editor1 = document.getElementById("<%= editor1.ClientID %>");
- var editdoc = editor1.GetDocument();
- editdoc.body.style.overflow="hidden";
- }
- </script>
Regards,
Ken