Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda