How to keep the scroll position

Last post 01-03-2008, 12:25 PM by huythan. 2 replies.
Sort Posts: Previous Next
  •  01-03-2008, 9:33 AM 36134

    How to keep the scroll position

    I have a custom function used to format the content. It will get all the content by getHTML() , process it, then set it to CuteEditor by setHTML().
    When I do that, the content of the editor start at the top instead of scrolling to the current position. 
    How can I keep the scroll position after formating ?
  •  01-03-2008, 11:51 AM 36137 in reply to 36134

    Re: How to keep the scroll position

    When using setHTML the whole document is reset. 
     
    >>How can I keep the scroll position after formating ?
     
    Please use the following method:

     
    PasteHTML()

    This method is used for pasting the specified HTML into a range within an editor document. If anything is selected, the selection is replaced with the new HTML and text.

    Example:

    // get the cute editor instance
    var editor1 = document.getElementById('<% = Editor1.ClientID%>');

    // pasting the specified HTML into a range within a editor document
    editor1.PasteHTML("Hello World");

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-03-2008, 12:25 PM 36139 in reply to 36137

    Re: How to keep the scroll position

    Unless the user select all the editor's content, the pasteHTML will duplicate my content.
    I want to replace the hold content with the formated content (format by my custom function) .
    And one thing, when I use select all, the pasteHTML function don't work
View as RSS news feed in XML