Force scroll in Kendo UI ScrollView for Angular

1 Answer 210 Views
ScrollView
Emna
Top achievements
Rank 1
Emna asked on 05 Apr 2022, 01:41 PM
I have a Scroll view component displaying a lot of images one by one (whenever you click the next or previous button the image changes) and i've been wondering : Is it possible to Force Scrolling to a Selected Element without clicking on the next/previuos button . I mean i can create a button (not related to the Kendo Scroll but related to one of the images) and whenever i click, it will scrolll automatically to that image. It is possible with Kendo for JQUERY when Handling the change event but i haven't found anything for angular.

1 Answer, 1 is accepted

Sort by
0
Accepted
Valentin
Telerik team
answered on 08 Apr 2022, 06:00 AM

Hi Emna,

Indeed it is possible to navigate to a specific image/component in the ScrollView by clicking a custom button. For that purpose, the activeIndex property of the component could be used.

https://www.telerik.com/kendo-angular-ui/components/scrollview/active-items/

To achieve the desired behavior update the activeIndex in the button click handler. Please see the following example that demonstrates such an approach:

https://stackblitz.com/edit/angular-ubomps-vqndcv

I hope this helps. 

Regards,
Valentin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Emna
Top achievements
Rank 1
commented on 20 Apr 2022, 01:35 PM

yes it did work indeed ! 

thank you

 

Tags
ScrollView
Asked by
Emna
Top achievements
Rank 1
Answers by
Valentin
Telerik team
Share this question
or