Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
Angular scroll 2 different scrollbars in ViewChildren

I have 2 components. The first one has a scrollbar, the second one has an *ngFor in which inside there is an accordion. Each accordion has a scrollbar. What I need is to scroll the first container and then scroll the first accordion till the last accordion. Basically the first div has a lot of images and the accordions are the categories. So I should be able to scroll the div with all images and see that the images in the relative accordions scrolls as well. This is what I've done so far. It works partially. The first accordion is correct. But the seconds starts not from the beggining, but from the end. It should be at 0 again and then scroll down.

scrollBoth(element: ElementRef) {
    const scrollDiv = element.nativeElement.children[0] as HTMLElement;
    this.imagesContainer.forEach(element => {
         const scrollImagesPanel = element.nativeElement as HTMLElement;
         scrollImagesPanel.scrollTop = scrollDiv .scrollTop;
    }); 
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!