Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda