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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...