Jump to content

Desktop HTMLFrame - Script Updated At Runtime - How Can We Force Scroll-To-Top via code ?


andyhill

Recommended Posts

Subject to user interaction we change the contents of a HTMLFrame (our frame has a pre-specified height):-

BeginUpdate
Clear

script

EndUpdate

The previous contents were many many lines long forcing the user to scroll to bottom, now that we have new contents I want to reposition to the top.

How Can We Force Scroll-To-Top in code ?

 

Link to comment
Share on other sites

6 hours ago, andyhill said:

Subject to user interaction we change the contents of a HTMLFrame (our frame has a pre-specified height):-

BeginUpdate
Clear

script

EndUpdate

The previous contents were many many lines long forcing the user to scroll to bottom, now that we have new contents I want to reposition to the top.

How Can We Force Scroll-To-Top in code ?

Hi,

Sorry, do you have a simple testcase to see the "problem"!?

Link to comment
Share on other sites

6 hours ago, andyhill said:

Please advise how to force in code at runtime a horizontal Scroll-To-Top for a HtmlFrame (after the script has been updated) - thanks.

Hi,

In your case:

procedure TMainForm.UniHTMLFrame1UpdateHtml(Sender: TObject);
begin
  UniPanel2.JSInterface.JSCall('body.setScrollTop', [0]);
end;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...