andyhill Posted December 25, 2021 Share Posted December 25, 2021 Attached is a shell project that I am having problems with Auto-Scroll, I would be happy for any help to solve - Thanks in advance. Project1.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 27, 2021 Share Posted December 27, 2021 On 12/26/2021 at 3:15 AM, andyhill said: Attached is a shell project that I am having problems with Auto-Scroll, I would be happy for any help to solve - Thanks in advance. Hello, And what is your problem!? Quote Link to comment Share on other sites More sharing options...
andyhill Posted December 27, 2021 Author Share Posted December 27, 2021 All my attempts to read / write / update current scroll position fail. The current code should fail as did the original. Please advise Thanks Sherzod Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 27, 2021 Share Posted December 27, 2021 5 minutes ago, andyhill said: All my attempts to read / write / update current scroll position fail. How?.. Quote Link to comment Share on other sites More sharing options...
andyhill Posted December 27, 2021 Author Share Posted December 27, 2021 Please check script in project "main.pas" Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 27, 2021 Share Posted December 27, 2021 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 27, 2021 Share Posted December 27, 2021 First of all, it is important for us to understand the algorithm of actions that you want to achieve... Quote Link to comment Share on other sites More sharing options...
andyhill Posted December 27, 2021 Author Share Posted December 27, 2021 1) Load HtmlFrame with display text / images 2) PLAY: Slowly Scroll HtmlFrame contents 3) PAUSE: Stop Scrolling 4) UNPAUSE(PLAY): Slowly Scroll HtmlFrame contents from current position 5) STOP WHEN REACHING THE END (1) and (5) are coded (2), (3) and (4) are the results of user interaction processed via JavaScript Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 27, 2021 Share Posted December 27, 2021 In your case, you set the AutoScroll property for the form to True, so you must scroll the form itself. Quote Link to comment Share on other sites More sharing options...
andyhill Posted December 27, 2021 Author Share Posted December 27, 2021 NO, I want code to scroll the contents at a pace set by my code. Please see:- https://codepen.io/startupsandcode/pen/MmXWaO Already commented in my code. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 27, 2021 Share Posted December 27, 2021 4 minutes ago, andyhill said: NO, I want code to scroll the contents at a pace set by my code. Okay. 20 minutes ago, Sherzod said: In your case, you set the AutoScroll property for the form to True, so you must scroll the form itself. But you have code like this at the moment, I just remind you. Quote Link to comment Share on other sites More sharing options...
andyhill Posted December 27, 2021 Author Share Posted December 27, 2021 Noted Sherzod, that's why I asked for help and included the website URL (where one can see the tele-prompter at work) in my code. I look forward to your advice on how to do this in UniGUI - thanks again. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 27, 2021 Share Posted December 27, 2021 I will try to analyze. Quote Link to comment Share on other sites More sharing options...
andyhill Posted December 31, 2021 Author Share Posted December 31, 2021 Any progress Sherzod ? Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 5, 2022 Author Share Posted January 5, 2022 Any progress Sherzod ? Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 9, 2022 Author Share Posted January 9, 2022 Any progress Sherzod ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 10, 2022 Share Posted January 10, 2022 On 1/9/2022 at 7:07 AM, andyhill said: Any progress Sherzod ? Hello, Sorry, couldn't get deeper into your case yet. Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 10, 2022 Author Share Posted January 10, 2022 OK, waiting ... Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 15, 2022 Author Share Posted January 15, 2022 Still waiting ... Quote Link to comment Share on other sites More sharing options...
DFong Posted January 16, 2022 Share Posted January 16, 2022 I am by no means a Javascript expert, but I've used requestAnimationFrame for simple animations in the past which sounds like it may work to implement something like what you want. Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 16, 2022 Author Share Posted January 16, 2022 Thanks for the tip, I have used requestAnimationFrame on a TUniCanvas before - all good. This is a THTMLFrame that requires scrolling from code. UniHTMLFrame1.JSInterface.JSCall('body.setScrollTop', [0]); $('+UniHTMLFrame1.JSName+').scrollTop(currentScroll+1);'+ Top Bottom CurrentPos etc. Quote Link to comment Share on other sites More sharing options...
DFong Posted January 17, 2022 Share Posted January 17, 2022 I've used requestAnimationFrame in a THTMLFrame to generate animations that are controlled from both the client side as well as from the server using JSCall in response to an Ajax event. There are plenty of examples on the web using requestAnimationFrame where the speed of the animation can be controlled. From the sounds of what you want to do, I still think this is the right direction to go. Not exactly what you want but this link may give you some ideas: https://medium.com/@roderickhsiao/implement-smooth-scrolling-79efb20b6535 Quote Link to comment Share on other sites More sharing options...
andyhill Posted January 18, 2022 Author Share Posted January 18, 2022 Thank you, would you be so kind as to use my sample project above and show me in code how to accomplish said task Quote Link to comment Share on other sites More sharing options...
DFong Posted January 18, 2022 Share Posted January 18, 2022 This is beyond my skillset as I'm no good with JavaScript and even worse with CSS, but here's another link that demonstrates how this could be done using another technique with keyframes/animation if you don't want to use the marquee tag or requestAnimationFrame: https://www.w3docs.com/snippets/css/how-to-have-the-marquee-effect-without-using-the-marquee-tag-with-css-javascript-and-jquery.html https://www.w3docs.com/tools/code-editor/2117 Good luck! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.