newsanti Posted January 29, 2023 Share Posted January 29, 2023 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2023 Share Posted January 29, 2023 Hello, Please explain in more detail. 1 Quote Link to comment Share on other sites More sharing options...
newsanti Posted January 29, 2023 Author Share Posted January 29, 2023 5 hours ago, Sherzod said: Hello, Please explain in more detail. ClientScrollBoxEvent.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2023 Share Posted January 29, 2023 12 minutes ago, newsanti said: ClientScrollBoxEvent.zip 98.44 kB · 0 downloads Try this approach: procedure TMainForm.UniButton1Click(Sender: TObject); begin //UniContainerPanel1.ScrollBy(-100,0); //not working UniContainerPanel1.JSInterface.JSCall('getScrollable().scrollBy', [-100, 0]); end; procedure TMainForm.UniButton2Click(Sender: TObject); begin //UniContainerPanel1.ScrollBy(100,0); //not working UniContainerPanel1.JSInterface.JSCall('getScrollable().scrollBy', [100, 0]); end; 1 Quote Link to comment Share on other sites More sharing options...
newsanti Posted January 29, 2023 Author Share Posted January 29, 2023 3 minutes ago, Sherzod said: Try this approach: procedure TMainForm.UniButton1Click(Sender: TObject); begin //UniContainerPanel1.ScrollBy(-100,0); //not working UniContainerPanel1.JSInterface.JSCall('getScrollable().scrollBy', [-100, 0]); end; procedure TMainForm.UniButton2Click(Sender: TObject); begin //UniContainerPanel1.ScrollBy(100,0); //not working UniContainerPanel1.JSInterface.JSCall('getScrollable().scrollBy', [100, 0]); end; procedure TMainForm.UniTimer1Timer(Sender: TObject); begin var oPanel:= UniContainerPanel1; UniContainerPanel1.JSInterface.JSCall('getScrollable().scrollBy', [50, 0]); end; How to Check..Left / Right Positon to Reverse Scroll? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2023 Share Posted January 29, 2023 41 minutes ago, newsanti said: How to Check..Left / Right Positon to Reverse Scroll? Try this approach: procedure TMainForm.UniTimer1Timer(Sender: TObject); begin UniContainerPanel1.JSInterface.JSCode( 'var container='#1';'+ 'if (container.getScrollable().getScrollElement().getScrollLeft() == 0) {delta=1};'+ 'if (container.getScrollable().getScrollElement().getScrollLeft()+container.width == container.getScrollable().getScrollElement().dom.scrollWidth) {delta=-1};'+ 'container.getScrollable().scrollBy(100*delta,0);' ) end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2023 Share Posted January 29, 2023 Even better to use with the third parameter "animate": container.getScrollable().scrollBy(100*delta,0,true); Quote Link to comment Share on other sites More sharing options...
newsanti Posted January 29, 2023 Author Share Posted January 29, 2023 19 minutes ago, Sherzod said: Try this approach: procedure TMainForm.UniTimer1Timer(Sender: TObject); begin UniContainerPanel1.JSInterface.JSCode( 'var container='#1';'+ 'if (container.getScrollable().getScrollElement().getScrollLeft() == 0) {delta=1};'+ 'if (container.getScrollable().getScrollElement().getScrollLeft()+container.width == container.getScrollable().getScrollElement().dom.scrollWidth) {delta=-1};'+ 'container.getScrollable().scrollBy(100*delta,0);' ) end; Stop When End Right. Not Back. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2023 Share Posted January 29, 2023 2 minutes ago, newsanti said: When End Right is Stop. Not Back. Sorry, then your case is not clear to me completely. I gave you the code above, from there you can take the logic (algorithm) for your case. Quote Link to comment Share on other sites More sharing options...
newsanti Posted January 29, 2023 Author Share Posted January 29, 2023 1 hour ago, Sherzod said: Sorry, then your case is not clear to me completely. I gave you the code above, from there you can take the logic (algorithm) for your case. delta is not -1 Quote Link to comment Share on other sites More sharing options...
newsanti Posted January 29, 2023 Author Share Posted January 29, 2023 Quote Link to comment Share on other sites More sharing options...
newsanti Posted January 29, 2023 Author Share Posted January 29, 2023 39 minutes ago, newsanti said: procedure TMainForm.UniTimer1Timer(Sender: TObject); begin var oPanel:= UniContainerPanel1; oPanel.JSInterface.JSCode( 'var container='#1';'+ 'if (container.getScrollable().getScrollElement().getScrollLeft() == 0) {delta=1};'+ 'if (container.getScrollable().getScrollElement().getScrollLeft()+container.width+20'+ ' >= container.getScrollable().getScrollElement().dom.scrollWidth) {delta=-1};'+ 'container.getScrollable().scrollBy(100*delta,0,true);' ) end; +20 is work! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 30, 2023 Share Posted January 30, 2023 9 hours ago, newsanti said: +20 is work! Well, if it works, then it's good. 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.